From 37a4dc6361a6ad84fd17f381ad7ef3db11f1cbaa Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 24 Oct 2023 11:48:26 -0400 Subject: [PATCH] v2.2.1: fixed crashes if spire is killed right after loading game --- .../shatteredpixeldungeon/actors/mobs/CrystalSpire.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/CrystalSpire.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/CrystalSpire.java index ebedd3d32..9377a3026 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/CrystalSpire.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/CrystalSpire.java @@ -336,6 +336,11 @@ public class CrystalSpire extends Mob { PixelScene.shake( 3, 0.7f ); Blacksmith.Quest.beatBoss(); + if (fieldOfView == null || fieldOfView.length != Dungeon.level.length()){ + fieldOfView = new boolean[Dungeon.level.length()]; + Dungeon.level.updateFieldOfView( CrystalSpire.this, fieldOfView ); + } + for (int i = 0; i < Dungeon.level.length(); i++){ if (fieldOfView[i] && Dungeon.level.map[i] == Terrain.MINE_CRYSTAL){ Level.set(i, Terrain.EMPTY);