]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/client.qc
Merged master into Lyberta/GivePlayerAmmo.
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / client.qc
index db0e478201de2df4385e257042a8c952019f8aca..0c12e40f0198b0d8063198acdaf30243e0984c2a 100644 (file)
@@ -1620,7 +1620,6 @@ void player_regen(entity this)
        regen_health_stable = M_ARGV(9, float);
        regen_health_rotstable = M_ARGV(10, float);
 
-
        if(!mutator_returnvalue)
        if(!STAT(FROZEN, this))
        {
@@ -1659,6 +1658,18 @@ void player_regen(entity this)
 
                this.ammo_fuel = CalcRotRegen(this.ammo_fuel, minf, autocvar_g_balance_fuel_regen, autocvar_g_balance_fuel_regenlinear, frametime * (time > this.pauseregen_finished) * ((this.items & ITEM_JetpackRegen.m_itemid) != 0), maxf, autocvar_g_balance_fuel_rot, autocvar_g_balance_fuel_rotlinear, frametime * (time > this.pauserotfuel_finished), limitf);
        }
+       // Ugly hack to make sure the haelth and armor don't go beyond hard limit.
+       // TODO: Remove this hack when all code uses GivePlayerHealth and
+       // GivePlayerArmor.
+       if (this.health > ITEM_COUNT_HARD_LIMIT)
+       {
+               this.health = ITEM_COUNT_HARD_LIMIT;
+       }
+       if (this.armorvalue > ITEM_COUNT_HARD_LIMIT)
+       {
+               this.armorvalue = ITEM_COUNT_HARD_LIMIT;
+       }
+       // End hack.
 }
 
 bool zoomstate_set;