v0.9.1a: added a couple safety checks

This commit is contained in:
Evan Debenham 2020-12-15 13:09:00 -05:00
parent 6ca2d6bc6b
commit 3ee49b98e4
2 changed files with 2 additions and 2 deletions

View File

@ -1048,7 +1048,7 @@ public class Hero extends Char {
public void rest( boolean fullRest ) {
spendAndNext( TIME_TO_REST );
if (!fullRest) {
if (!fullRest && sprite != null) {
sprite.showStatus( CharSprite.DEFAULT, Messages.get(this, "wait") );
}
resting = fullRest;

View File

@ -269,7 +269,7 @@ public class Toolbar extends Component {
if (lastEnabled != (Dungeon.hero.ready && Dungeon.hero.isAlive())) {
lastEnabled = (Dungeon.hero.ready && Dungeon.hero.isAlive());
for (Gizmo tool : members) {
for (Gizmo tool : members.toArray(new Gizmo[0])) {
if (tool instanceof Tool) {
((Tool)tool).enable( lastEnabled );
}