v0.7.5: added a safety check for characters taking damage

This commit is contained in:
Evan Debenham 2019-09-29 21:49:19 -04:00
parent 3990f7b30b
commit 39c9c37783

View File

@ -419,10 +419,12 @@ public abstract class Char extends Actor {
shielded -= dmg;
HP -= dmg;
if (sprite != null) {
sprite.showStatus(HP > HT / 2 ?
CharSprite.WARNING :
CharSprite.NEGATIVE,
Integer.toString(dmg + shielded));
}
if (HP < 0) HP = 0;