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; shielded -= dmg;
HP -= dmg; HP -= dmg;
sprite.showStatus( HP > HT / 2 ? if (sprite != null) {
CharSprite.WARNING : sprite.showStatus(HP > HT / 2 ?
CharSprite.NEGATIVE, CharSprite.WARNING :
Integer.toString( dmg + shielded ) ); CharSprite.NEGATIVE,
Integer.toString(dmg + shielded));
}
if (HP < 0) HP = 0; if (HP < 0) HP = 0;