From 5d1669431dd4d47b57c9a466d9882ba7bf164aef Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 21 Aug 2017 00:04:55 -0400 Subject: [PATCH] v0.6.1b: Levels no longer set Dungeon.visible --- .../shatteredpixel/shatteredpixeldungeon/levels/Level.java | 7 ++++--- .../shatteredpixeldungeon/levels/RegularLevel.java | 2 +- .../shatteredpixeldungeon/scenes/InterlevelScene.java | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java index 51d01b139..0ab7b0ade 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java @@ -261,7 +261,6 @@ public abstract class Level implements Bundlable { visited = new boolean[length]; mapped = new boolean[length]; - Dungeon.visible = new boolean[length]; fieldOfView = new boolean[length()]; @@ -527,7 +526,9 @@ public abstract class Level implements Bundlable { int cell; do { cell = Random.Int( length() ); - } while (!passable[cell] || Dungeon.visible[cell] || Actor.findChar( cell ) != null); + } while ((Dungeon.level == this && Dungeon.visible[cell]) + || !passable[cell] + || Actor.findChar( cell ) != null); return cell; } @@ -668,7 +669,7 @@ public abstract class Level implements Bundlable { if (heap == null) { heap = new Heap(); - heap.seen = Dungeon.visible[cell]; + heap.seen = Dungeon.level == this && Dungeon.visible[cell]; heap.pos = cell; if (map[cell] == Terrain.CHASM || (Dungeon.level != null && pit[cell])) { Dungeon.dropToChasm( item ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java index c86ecea23..b7432da64 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/RegularLevel.java @@ -254,7 +254,7 @@ public abstract class RegularLevel extends Level { } cell = pointToCell(room.random(1)); - if (!Dungeon.visible[cell] + if ((Dungeon.level != this || !Dungeon.visible[cell]) && Actor.findChar( cell ) == null && Level.passable[cell] && cell != exit) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/InterlevelScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/InterlevelScene.java index 374c92aaa..11b000ac9 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/InterlevelScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/InterlevelScene.java @@ -84,6 +84,8 @@ public class InterlevelScene extends PixelScene { phase = Phase.FADE_IN; timeLeft = TIME_TO_FADE; + + Dungeon.visible = null; thread = new Thread() { @Override