From f7e94367c693a88e837313f969d1500cb36f8938 Mon Sep 17 00:00:00 2001 From: Lyberta Date: Sat, 26 Aug 2017 21:10:16 +0300 Subject: [PATCH] Better hard limit check. --- qcsrc/server/client.qc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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. } -- 2.39.2