]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a think function for the secondary grenade, this clears up the issue with func...
authorSamual <samual@xonotic.org>
Sun, 14 Aug 2011 20:54:28 +0000 (16:54 -0400)
committerSamual <samual@xonotic.org>
Sun, 14 Aug 2011 20:54:28 +0000 (16:54 -0400)
qcsrc/server/w_grenadelauncher.qc

index 1d2ee93b9a2cfb8778d290f69f5071b0491b55ed..077318055c03cbf3f9fc24918a788073df24b1f0 100644 (file)
@@ -70,6 +70,18 @@ void W_Grenade_Think1 (void)
                W_Grenade_Explode();
 }
 
+void W_Grenade_Think2 (void)
+{
+       self.nextthink = time;
+       if (time > self.cnt)
+       {
+               other = world;
+               self.projectiledeathtype |= HITTYPE_BOUNCE;
+               W_Grenade_Explode2 ();
+               return;
+       }
+}
+
 void W_Grenade_Touch1 (void)
 {
        PROJECTILE_TOUCH;
@@ -141,7 +153,7 @@ void W_Grenade_Touch2 (void)
                self.gl_bouncecnt += 1;
                
                if (autocvar_g_balance_grenadelauncher_secondary_lifetime_bounce && self.gl_bouncecnt == 1)
-                       self.nextthink = time + autocvar_g_balance_grenadelauncher_secondary_lifetime_bounce;
+                       self.cnt = time + autocvar_g_balance_grenadelauncher_secondary_lifetime_bounce;
                        
        }
        else if(autocvar_g_balance_grenadelauncher_secondary_type == 2 && (!other || (other.takedamage != DAMAGE_AIM && other.movetype == MOVETYPE_NONE))) // stick
@@ -233,8 +245,9 @@ void W_Grenade_Attack2 (void)
        setorigin(gren, w_shotorg);
        setsize(gren, '-3 -3 -3', '3 3 3');
 
-       gren.nextthink = time + autocvar_g_balance_grenadelauncher_secondary_lifetime;
-       gren.think = adaptor_think2use_hittype_splash;
+       gren.cnt = time + autocvar_g_balance_grenadelauncher_secondary_lifetime;
+       gren.nextthink = time;
+       gren.think = W_Grenade_Think2;
        gren.use = W_Grenade_Explode2;
        gren.touch = W_Grenade_Touch2;