From: FruitieX Date: Thu, 25 Nov 2010 12:29:06 +0000 (+0200) Subject: some small freezetag bugfixes X-Git-Tag: xonotic-v0.1.0preview~86^2~2^2~10 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7995e25c34f2caa1988de72496b1a7e4d52e6c53;p=xonotic%2Fxonotic-data.pk3dir.git some small freezetag bugfixes --- diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 2985b45b4..a4ef3867b 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -1338,6 +1338,10 @@ void ClientKill (void) { // do nothing } + else if(g_freezetag && self.freezetag_frozen == 1) + { + // do nothing + } else ClientKill_TeamChange(0); } diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index 9d5f724a5..d62ade2be 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -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) { diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index c9cec9745..c3e56a3d0 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -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"); diff --git a/qcsrc/server/mutators/gamemode_freezetag.qc b/qcsrc/server/mutators/gamemode_freezetag.qc index 14fe430f1..d9e60a8e2 100644 --- a/qcsrc/server/mutators/gamemode_freezetag.qc +++ b/qcsrc/server/mutators/gamemode_freezetag.qc @@ -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; } diff --git a/qcsrc/server/w_electro.qc b/qcsrc/server/w_electro.qc index 59eb4382b..29c4d5b1f 100644 --- a/qcsrc/server/w_electro.qc +++ b/qcsrc/server/w_electro.qc @@ -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;