]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
My version of rocket flying TimePath/balance/rocketflying
authorTimePath <andrew.hardaker1995@gmail.com>
Fri, 15 Jun 2018 11:04:31 +0000 (21:04 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Fri, 15 Jun 2018 11:04:31 +0000 (21:04 +1000)
qcsrc/common/weapons/weapon/devastator.qc

index 6333a791dd537416768e2fd43c4c8aeb6ed71a8f..d2de5098cd7f3ddff53eb5d165fe55d3600ed76c 100644 (file)
@@ -334,7 +334,12 @@ void W_Devastator_Attack(Weapon thiswep, entity actor, .entity weaponentity, int
        missile.projectiledeathtype = WEP_DEVASTATOR.m_id;
        setsize(missile, '-3 -3 -3', '3 3 3'); // give it some size so it can be shot
 
-       setorigin(missile, w_shotorg - v_forward * 3); // move it back so it hits the wall at the right point
+    bool rocketFlying = boolean(fire & 2);
+    if (rocketFlying) {
+           setorigin(missile, w_shotorg);
+    } else {
+           setorigin(missile, w_shotorg - (v_forward * 3)); // move it back so it hits the wall at the right point
+       }
        W_SetupProjVelocity_Basic(missile, WEP_CVAR(devastator, speedstart), 0);
        missile.angles = vectoangles(missile.velocity);
 
@@ -342,7 +347,6 @@ void W_Devastator_Attack(Weapon thiswep, entity actor, .entity weaponentity, int
        setthink(missile, W_Devastator_Think);
        missile.nextthink = time;
        missile.cnt = time + WEP_CVAR(devastator, lifetime);
-       missile.detonate_later = (fire & 2); // allow instant detonation
        missile.flags = FL_PROJECTILE;
        IL_PUSH(g_projectiles, missile);
        IL_PUSH(g_bot_dodge, missile);
@@ -360,9 +364,8 @@ void W_Devastator_Attack(Weapon thiswep, entity actor, .entity weaponentity, int
        // common properties
        MUTATOR_CALLHOOK(EditProjectile, actor, missile);
 
-       if (time >= missile.nextthink)
-       {
-               getthink(missile)(missile);
+       if (rocketFlying) {
+        W_Devastator_RemoteExplode(missile, weaponentity);
        }
 }