v1.4.2: added a few safety checks
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user