]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Restore infinite mine lifetime function
authorMario <zacjardine@y7mail.com>
Sat, 13 Dec 2014 08:22:51 +0000 (19:22 +1100)
committerMario <zacjardine@y7mail.com>
Sat, 13 Dec 2014 08:22:51 +0000 (19:22 +1100)
qcsrc/common/weapons/w_minelayer.qc

index e0e9c6256f8abc5a982fe5e81acfc87144d29006..970192e31c094bd648ff25264bc1373f0a688aa1 100644 (file)
@@ -221,7 +221,7 @@ void W_MineLayer_Think(void)
        
        // our lifetime has expired, it's time to die - mine_time just allows us to play a sound for this
        // TODO: replace this mine_trigger.wav sound with a real countdown
-       if((time > self.cnt) && (!self.mine_time))
+       if((time > self.cnt) && (!self.mine_time) && (self.cnt > 0))
        {
                if(WEP_CVAR(minelayer, lifetime_countdown) > 0)
                        spamsound(self, CH_SHOTS, "weapons/mine_trigger.wav", VOL_BASE, ATTN_NORM);
@@ -357,10 +357,12 @@ void W_MineLayer_Attack(void)
        mine.touch = W_MineLayer_Touch;
        mine.think = W_MineLayer_Think;
        mine.nextthink = time;
-       mine.cnt = time + (WEP_CVAR(minelayer, lifetime) - WEP_CVAR(minelayer, lifetime_countdown));
+       mine.cnt = (WEP_CVAR(minelayer, lifetime) - WEP_CVAR(minelayer, lifetime_countdown));
        mine.flags = FL_PROJECTILE;
        mine.missile_flags = MIF_SPLASH | MIF_ARC | MIF_PROXY;
 
+       if(mine.cnt > 0) { mine.cnt += time; }
+
        CSQCProjectile(mine, TRUE, PROJECTILE_MINE, TRUE);
 
        // muzzle flash for 1st person view