]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Some1 created ITEM_DAMAGE_NEEDKILL, why not use it? Also remove DEATH_FALL (shouldn...
authorterencehill <piuntn@gmail.com>
Tue, 18 Dec 2012 23:58:23 +0000 (00:58 +0100)
committerterencehill <piuntn@gmail.com>
Tue, 18 Dec 2012 23:58:23 +0000 (00:58 +0100)
qcsrc/server/mutators/gamemode_freezetag.qc

index abb21b02fa8d90cf9b611ccf586b9f0b14425d4f..ca06458b0b562bbd7ae390e027af7a5b6a439736 100644 (file)
@@ -328,28 +328,21 @@ MUTATOR_HOOKFUNCTION(freezetag_PlayerDies)
                return 1; // let the player die so that he can respawn whenever he wants
        }
 
-       switch(frag_deathtype)
+       // Cases DEATH_TEAMCHANGE and DEATH_AUTOTEAMCHANGE are needed to fix a bug whe
+       // you succeed changing team through the menu: you both really die (gibbing) and get frozen
+       if(ITEM_DAMAGE_NEEDKILL(frag_deathtype)
+               || frag_deathtype == DEATH_TEAMCHANGE || frag_deathtype == DEATH_AUTOTEAMCHANGE)
        {
-               case DEATH_HURTTRIGGER:
-               case DEATH_FALL:
-               case DEATH_DROWN:
-               case DEATH_LAVA:
-               case DEATH_SLIME:
-               case DEATH_SWAMP:
-               case DEATH_TEAMCHANGE:
-               case DEATH_AUTOTEAMCHANGE:
+               // let the player die, he will be automatically frozen when he respawns
+               if(!self.freezetag_frozen)
                {
-                       // let the player die, he will be automatically frozen when he respawns
-                       if(!self.freezetag_frozen)
-                       {
-                               freezetag_Add_Score(frag_attacker);
-                               freezetag_count_alive_players();
-                       }
-                       else
-                               freezetag_Unfreeze(world); // remove ice
-                       self.freezetag_frozen_timeout = -2; // freeze on respawn
-                       return 1;
+                       freezetag_Add_Score(frag_attacker);
+                       freezetag_count_alive_players();
                }
+               else
+                       freezetag_Unfreeze(world); // remove ice
+               self.freezetag_frozen_timeout = -2; // freeze on respawn
+               return 1;
        }
 
        if(self.freezetag_frozen)