From: Samual Date: Sat, 31 Mar 2012 16:29:54 +0000 (-0400) Subject: Add proper checks for NEEDKILL X-Git-Tag: xonotic-v0.7.0~240^2~142 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3d08a1c92bb3e8407e836064da22a5d2ba4ac2f1;p=xonotic%2Fxonotic-data.pk3dir.git Add proper checks for NEEDKILL --- diff --git a/qcsrc/server/mutators/gamemode_ctf.qc b/qcsrc/server/mutators/gamemode_ctf.qc index 110f20177..b4b1fe0e4 100644 --- a/qcsrc/server/mutators/gamemode_ctf.qc +++ b/qcsrc/server/mutators/gamemode_ctf.qc @@ -503,7 +503,7 @@ void ctf_CheckFlagReturn(entity flag) void ctf_FlagDamage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force) { - if(deathtype == DEATH_HURTTRIGGER || deathtype == DEATH_SLIME || deathtype == DEATH_LAVA) + if(ITEM_DAMAGE_NEEDKILL(deathtype)) { // automatically kill the flag and return it self.health = 0; @@ -592,7 +592,13 @@ void ctf_FlagTouch() if(gameover) { return; } if(!self) { return; } if(other.deadflag != DEAD_NO) { return; } - + if(ITEM_TOUCH_NEEDKILL()) + { + // automatically kill the flag and return it + self.health = 0; + ctf_CheckFlagReturn(self); + return; + } if(other.classname != "player") // The flag just touched an object, most likely the world { if(time > self.wait) // if we haven't in a while, play a sound/effect