v0.7.5: added a safety check for characters taking damage
This commit is contained in:
parent
3990f7b30b
commit
39c9c37783
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user