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;
|
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;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user