diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM201.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM201.java index 911886ec4..6783f61a6 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM201.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM201.java @@ -54,6 +54,13 @@ public class DM201 extends DM200 { @Override protected boolean act() { + + //in case DM-201 hasn't been able to act yet + if (fieldOfView == null || fieldOfView.length != Dungeon.level.length()){ + fieldOfView = new boolean[Dungeon.level.length()]; + Dungeon.level.updateFieldOfView( this, fieldOfView ); + } + GameScene.add(Blob.seed(pos, 0, CorrosiveGas.class)); if (state == HUNTING && enemy != null && enemySeen && threatened && !Dungeon.level.adjacent(pos, enemy.pos)){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/AttackIndicator.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/AttackIndicator.java index b1d7d5d06..2d7658fd5 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/AttackIndicator.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/AttackIndicator.java @@ -45,7 +45,7 @@ public class AttackIndicator extends Tag { private CharSprite sprite = null; - private static Mob lastTarget; + private Mob lastTarget; private ArrayList candidates = new ArrayList<>(); public AttackIndicator() { @@ -74,7 +74,7 @@ public class AttackIndicator extends Tag { super.layout(); if (sprite != null) { - sprite.x = x + (width - sprite.width()) / 2; + sprite.x = x + (width - sprite.width()) / 2 + 1; sprite.y = y + (height - sprite.height()) / 2; PixelScene.align(sprite); } @@ -148,9 +148,7 @@ public class AttackIndicator extends Tag { sprite.paused = true; add( sprite ); - sprite.x = x + (width - sprite.width()) / 2 + 1; - sprite.y = y + (height - sprite.height()) / 2; - PixelScene.align(sprite); + layout(); } private boolean enabled = true; @@ -178,10 +176,12 @@ public class AttackIndicator extends Tag { } public static void target( Char target ) { - lastTarget = (Mob)target; - instance.updateImage(); - - TargetHealthIndicator.instance.target( target ); + synchronized (instance) { + instance.lastTarget = (Mob) target; + instance.updateImage(); + + TargetHealthIndicator.instance.target(target); + } } public static void updateState() { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndStartGame.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndStartGame.java index 85b83cd42..306eac75e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndStartGame.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndStartGame.java @@ -125,8 +125,10 @@ public class WndStartGame extends Window { ShatteredPixelDungeon.scene().addToFront(new WndChallenges(SPDSettings.challenges(), true) { public void onBackPressed() { super.onBackPressed(); - icon( Icons.get( SPDSettings.challenges() > 0 ? - Icons.CHALLENGE_ON :Icons.CHALLENGE_OFF ) ); + if (parent != null) { + icon(Icons.get(SPDSettings.challenges() > 0 ? + Icons.CHALLENGE_ON : Icons.CHALLENGE_OFF)); + } } } ); }