From 3d08a1c92bb3e8407e836064da22a5d2ba4ac2f1 Mon Sep 17 00:00:00 2001 From: Samual Date: Sat, 31 Mar 2012 12:29:54 -0400 Subject: [PATCH] Add proper checks for NEEDKILL --- qcsrc/server/mutators/gamemode_ctf.qc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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 -- 2.39.2