// 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.
}