v1.4.2: added a few safety checks
This commit is contained in:
+3
-3
@@ -83,13 +83,13 @@ public class SpellSprite extends Image {
|
|||||||
@Override
|
@Override
|
||||||
public void update() {
|
public void update() {
|
||||||
super.update();
|
super.update();
|
||||||
|
|
||||||
if (target.sprite != null) {
|
if (target != null && target.sprite != null) {
|
||||||
x = target.sprite.center().x - SIZE / 2;
|
x = target.sprite.center().x - SIZE / 2;
|
||||||
y = target.sprite.y - SIZE;
|
y = target.sprite.y - SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (phase == null){
|
if (phase == null || target == null){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -116,7 +116,9 @@ public class DangerIndicator extends Tag {
|
|||||||
QuickSlotButton.target(target);
|
QuickSlotButton.target(target);
|
||||||
if (Dungeon.hero.canAttack(target)) AttackIndicator.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