]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_damage.qc
Clean up code by avoiding resetting player's health in Unfreeze as it's not needed...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_damage.qc
index eb05e2c85b7e87e24ba7749d8ceee21ed5760286..c2c2b85bc54bcf0678121697bc2334ae40ba69a5 100644 (file)
@@ -529,16 +529,15 @@ void Freeze(entity targ, float revivespeed, int frozen_type, bool show_waypoint)
                WaypointSprite_Spawn(WP_Frozen, 0, 0, targ, '0 0 64', NULL, targ.team, targ, waypointsprite_attached, true, RADARICON_WAYPOINT);
 }
 
-void Unfreeze(entity targ)
+void Unfreeze(entity targ, bool reset_health)
 {
        if(!STAT(FROZEN, targ))
                return;
 
-       if(STAT(FROZEN, targ) && STAT(FROZEN, targ) != 3) // only reset health if target was frozen
-       {
+       if (reset_health && STAT(FROZEN, targ) != 3) // only reset health if target was frozen
                SetResourceAmount(targ, RESOURCE_HEALTH, ((IS_PLAYER(targ)) ? start_health : targ.max_health));
-               targ.pauseregen_finished = time + autocvar_g_balance_pause_health_regen;
-       }
+
+       targ.pauseregen_finished = time + autocvar_g_balance_pause_health_regen;
 
        STAT(FROZEN, targ) = 0;
        STAT(REVIVE_PROGRESS, targ) = 0;
@@ -697,7 +696,7 @@ void Damage(entity targ, entity inflictor, entity attacker, float damage, int de
                        if(deathtype == DEATH_FALL.m_id)
                        if(damage >= autocvar_g_frozen_revive_falldamage)
                        {
-                               Unfreeze(targ);
+                               Unfreeze(targ, false);
                                SetResourceAmount(targ, RESOURCE_HEALTH, autocvar_g_frozen_revive_falldamage_health);
                                Send_Effect(EFFECT_ICEORGLASS, targ.origin, '0 0 0', 3);
                                Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_FREEZETAG_REVIVED_FALL, targ.netname);