some small freezetag bugfixes
authorFruitieX <fruitiex@gmail.com>
Thu, 25 Nov 2010 12:29:06 +0000 (14:29 +0200)
committerFruitieX <fruitiex@gmail.com>
Thu, 25 Nov 2010 12:29:06 +0000 (14:29 +0200)
qcsrc/server/cl_client.qc
qcsrc/server/cl_player.qc
qcsrc/server/g_damage.qc
qcsrc/server/mutators/gamemode_freezetag.qc
qcsrc/server/w_electro.qc

index 2985b45..a4ef386 100644 (file)
@@ -1338,6 +1338,10 @@ void ClientKill (void)
        {
                // do nothing
        }
+    else if(g_freezetag && self.freezetag_frozen == 1)
+    {
+        // do nothing
+    }
        else
                ClientKill_TeamChange(0);
 }
index 9d5f724..d62ade2 100644 (file)
@@ -387,6 +387,7 @@ void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, float
 
 void ClientKill_Now_TeamChange();
 void freezetag_CheckWinner();
+void freezetag_Unfreeze();
 
 void PlayerDamage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
 {
@@ -611,7 +612,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                race_PreDie();
                DropAllRunes(self);
 
-               if(deathtype == DEATH_HURTTRIGGER)
+               if(deathtype == DEATH_HURTTRIGGER && g_freezetag)
                {
                        PutClientInServer();
                        count_alive_players(); // re-count players
@@ -625,7 +626,12 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                MUTATOR_CALLHOOK(PlayerDies);
 
                if(g_freezetag)
-                       return;
+        {
+            if(!defer_ClientKill_Now_TeamChange)
+                return;
+            else // team change...
+                freezetag_Unfreeze(); // remove all ice blocks 
+        }
 
                if(self.flagcarried)
                {
index c9cec97..c3e56a3 100644 (file)
@@ -528,7 +528,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
 
                if(g_freezetag)
                {
-                       if(targ.freezetag_frozen == 1)
+                       if(targ.freezetag_frozen == 1 && deathtype != DEATH_KILL) // we still need teamchange to actually kill
                        {
                                damage = 0;
                                force = force * cvar("g_freezetag_frozen_force");
index 14fe430..d9e60a8 100644 (file)
@@ -159,6 +159,8 @@ MUTATOR_HOOKFUNCTION(freezetag_PlayerDies)
 
 MUTATOR_HOOKFUNCTION(freezetag_PlayerSpawn)
 {
+    freezetag_Unfreeze(); // start by making sure that all ice blocks are removed
+
        if(totalspawned == 1 && time > game_starttime) // only one player active on server, start a new match immediately
        if(!next_round && warmup && (time < warmup - cvar("g_freezetag_warmup") || time > warmup)) // not awaiting next round
        {
@@ -170,10 +172,6 @@ MUTATOR_HOOKFUNCTION(freezetag_PlayerSpawn)
                centerprint(self, "^1You spawned after the round started, you'll spawn as frozen.\n");
                freezetag_Freeze();
        }
-       else // we are still in the delay period before the round starts
-       {
-               freezetag_Unfreeze();
-       }
 
        return 1;
 }
index 59eb438..29c4d5b 100644 (file)
@@ -231,7 +231,7 @@ void lgbeam_think()
                remove(self);
                return;
        }
-       if (self.owner.weaponentity.state != WS_INUSE || (self.owner.ammo_cells <= 0 && !(self.owner.items & IT_UNLIMITED_WEAPON_AMMO)) || self.owner.deadflag != DEAD_NO || !self.owner.BUTTON_ATCK || (g_freezetag && self.freezetag_frozen)
+       if (self.owner.weaponentity.state != WS_INUSE || (self.owner.ammo_cells <= 0 && !(self.owner.items & IT_UNLIMITED_WEAPON_AMMO)) || self.owner.deadflag != DEAD_NO || !self.owner.BUTTON_ATCK || (g_freezetag && self.freezetag_frozen))
        {
                if(self == self.owner.lgbeam)
                        self.owner.lgbeam = world;