]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add proper checks for NEEDKILL
authorSamual <samual@xonotic.org>
Sat, 31 Mar 2012 16:29:54 +0000 (12:29 -0400)
committerSamual <samual@xonotic.org>
Sat, 31 Mar 2012 16:29:54 +0000 (12:29 -0400)
qcsrc/server/mutators/gamemode_ctf.qc

index 110f2017779d30c2afe2a2e998398e3de77eab24..b4b1fe0e4b43e65209ff274d24168ed9c1de3236 100644 (file)
@@ -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