From 7cf3e926c48dbb2f44825fbb0c7099af43a3fb44 Mon Sep 17 00:00:00 2001 From: terencehill Date: Thu, 22 Sep 2016 18:40:18 +0200 Subject: [PATCH] Delay health regen once the player gets revived rather than every frame while they are frozen --- qcsrc/server/g_damage.qc | 3 +++ qcsrc/server/mutators/mutator/gamemode_freezetag.qc | 13 ++----------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index b8b13c8db..cb43861ac 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -572,7 +572,10 @@ void Unfreeze (entity targ) return; if(STAT(FROZEN, targ) && STAT(FROZEN, targ) != 3) // only reset health if target was frozen + { targ.health = ((IS_PLAYER(targ)) ? start_health : targ.max_health); + targ.pauseregen_finished = time + autocvar_g_balance_pause_health_regen; + } STAT(FROZEN, targ) = 0; targ.revive_progress = 0; diff --git a/qcsrc/server/mutators/mutator/gamemode_freezetag.qc b/qcsrc/server/mutators/mutator/gamemode_freezetag.qc index 9d4abe6d8..32c91d8c1 100644 --- a/qcsrc/server/mutators/mutator/gamemode_freezetag.qc +++ b/qcsrc/server/mutators/mutator/gamemode_freezetag.qc @@ -432,22 +432,13 @@ MUTATOR_HOOKFUNCTION(ft, PlayerPreThink, CBC_ORDER_FIRST) if(gameover) return true; - entity player = M_ARGV(0, entity); - - if(STAT(FROZEN, player) == 1) - { - // keep health = 1 - player.pauseregen_finished = time + autocvar_g_balance_pause_health_regen; - } - if(round_handler_IsActive()) if(!round_handler_IsRoundStarted()) return true; int n; - - entity o; - o = NULL; + entity o = NULL; + entity player = M_ARGV(0, entity); //if(STAT(FROZEN, player)) //if(player.freezetag_frozen_timeout > 0 && time < player.freezetag_frozen_timeout) //player.iceblock.alpha = ICE_MIN_ALPHA + (ICE_MAX_ALPHA - ICE_MIN_ALPHA) * (player.freezetag_frozen_timeout - time) / (player.freezetag_frozen_timeout - player.freezetag_frozen_time); -- 2.39.2