]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
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 2985b45b41262b4f9ac4ed51749d34323203a639..a4ef3867b6b9467efa625cb88ebda402ffac625e 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 9d5f724a5033dde4bab9a4466c5090ad89179db3..d62ade2bee2b77dfc2d265f2954e0ce02dcd0abe 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 c9cec9745e87a294e8d4ceaf28071079a1052c52..c3e56a3d044085f4fd1ed6a5cf8cff2b8d2f42f9 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 14fe430f1209b8cc6496eddb165d497864b3d15f..d9e60a8e22b50ce43c41fc2bf921fc730b6d697d 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 59eb4382bd78b95a0f19a2c7ef1921d2038e5e61..29c4d5b1fd8c6930e0a5a5cef0a84efb6a367a5b 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;