From: Lyberta Date: Sat, 26 Aug 2017 18:10:16 +0000 (+0300) Subject: Better hard limit check. X-Git-Tag: xonotic-v0.8.5~2499^2~5 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f7e94367c693a88e837313f969d1500cb36f8938;p=xonotic%2Fxonotic-data.pk3dir.git Better hard limit check. --- diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 9357e1b7d..24ed8ffbb 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -1663,8 +1663,14 @@ void player_regen(entity this) // 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); + 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. }