v1.4.2: added a few safety checks

This commit is contained in:
Evan Debenham
2022-10-17 12:32:59 -04:00
parent 49b73a7575
commit 9599d7a420
2 changed files with 6 additions and 4 deletions

View File

@@ -83,13 +83,13 @@ public class SpellSprite extends Image {
@Override
public void update() {
super.update();
if (target.sprite != null) {
if (target != null && target.sprite != null) {
x = target.sprite.center().x - SIZE / 2;
y = target.sprite.y - SIZE;
}
if (phase == null){
if (phase == null || target == null){
return;
}

View File

@@ -116,7 +116,9 @@ public class DangerIndicator extends Tag {
QuickSlotButton.target(target);
if (Dungeon.hero.canAttack(target)) AttackIndicator.target(target);
if (Dungeon.hero.curAction == null) Camera.main.panTo(target.sprite.center(), 5f);
if (Dungeon.hero.curAction == null && target.sprite != null) {
Camera.main.panTo(target.sprite.center(), 5f);
}
}
}