]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Delay health regen once the player gets revived rather than every frame while they...
authorterencehill <piuntn@gmail.com>
Thu, 22 Sep 2016 16:40:18 +0000 (18:40 +0200)
committerterencehill <piuntn@gmail.com>
Thu, 22 Sep 2016 16:40:18 +0000 (18:40 +0200)
qcsrc/server/g_damage.qc
qcsrc/server/mutators/mutator/gamemode_freezetag.qc

index b8b13c8db3d688481f09cfcd78966d3dd8752453..cb43861acf4ae272ffc7f67ae07950dbf2c03977 100644 (file)
@@ -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;
index 9d4abe6d87a0e051f96ae55e9e888ac681c434ab..32c91d8c17d20fb6f6e9fdaeb4eb9b0f0e31ec98 100644 (file)
@@ -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);