From: Mario Date: Sat, 13 Dec 2014 08:22:51 +0000 (+1100) Subject: Restore infinite mine lifetime function X-Git-Tag: xonotic-v0.8.0~107 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=93b253d5444edb1ca11db25a8e7bba1b50610fa4;p=xonotic%2Fxonotic-data.pk3dir.git Restore infinite mine lifetime function --- diff --git a/qcsrc/common/weapons/w_minelayer.qc b/qcsrc/common/weapons/w_minelayer.qc index e0e9c6256..970192e31 100644 --- a/qcsrc/common/weapons/w_minelayer.qc +++ b/qcsrc/common/weapons/w_minelayer.qc @@ -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