]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Moved HARD_LIMIT check a bit.
authorLyberta <lyberta@lyberta.net>
Sat, 26 Aug 2017 16:37:14 +0000 (19:37 +0300)
committerLyberta <lyberta@lyberta.net>
Sat, 26 Aug 2017 16:37:14 +0000 (19:37 +0300)
qcsrc/common/t_items.qc
qcsrc/server/client.qc

index 9a6d4e397ede709f7c39178337cd06b3df751330..14a8f14bf05ef4395fd59d2e9cfb369dd6201399 100644 (file)
@@ -686,7 +686,7 @@ void GivePlayerArmor(entity player, float amount)
 
 void GivePlayerAmmo(entity player, .float ammotype, float amount)
 {
-       float maxvalue = 999;
+       float maxvalue = ITEM_COUNT_HARD_LIMIT;
        switch (ammotype)
        {
                case ammo_shells:
index 143514c2e4655c0394a6c3968606fbd80f499962..9357e1b7dc3bc79ce3867803b41ceae1f1cc9a12 100644 (file)
@@ -1622,13 +1622,6 @@ void player_regen(entity this)
        regen_health_stable = M_ARGV(9, float);
        regen_health_rotstable = M_ARGV(10, float);
 
-       // 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.
-       this.health = bound(0, this.health, ITEM_COUNT_HARD_LIMIT);
-       this.armorvalue = bound(0, this.armorvalue, ITEM_COUNT_HARD_LIMIT);
-       // End hack.
-
        if(!mutator_returnvalue)
        if(!STAT(FROZEN, this))
        {
@@ -1667,6 +1660,12 @@ 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.
+       this.health = bound(0, this.health, ITEM_COUNT_HARD_LIMIT);
+       this.armorvalue = bound(0, this.armorvalue, ITEM_COUNT_HARD_LIMIT);
+       // End hack.
 }
 
 bool zoomstate_set;