]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/client.qc
Better hard limit check.
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / client.qc
index 9357e1b7dc3bc79ce3867803b41ceae1f1cc9a12..24ed8ffbbdd95646303ac900bf61d6b9abfc8640 100644 (file)
@@ -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.
 }