From 39bfb3c2d861b2b7d9dcedd0fc0f9c1961cad453 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 5 Feb 2018 19:52:51 -0500 Subject: [PATCH] v0.6.3: fixed further crashes with wall blocking logic --- .../shatteredpixeldungeon/tiles/WallBlockingTilemap.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/WallBlockingTilemap.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/WallBlockingTilemap.java index 9df867643..32f1d1b73 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/WallBlockingTilemap.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/WallBlockingTilemap.java @@ -77,8 +77,7 @@ public class WallBlockingTilemap extends Tilemap { //- There are cells 2x below //- The cell below is a wall and visible //- All of left, below-left, right, below-right is either a wall or hidden - } else if ( ((cell + 2*mapWidth) < size) - && !fogHidden(cell + mapWidth) + } else if ( !fogHidden(cell + mapWidth) && (fogHidden(cell - 1) || wall(cell - 1)) && (fogHidden(cell + 1) || wall(cell + 1)) && (fogHidden(cell - 1 + mapWidth) || wall(cell - 1 + mapWidth)) @@ -178,7 +177,7 @@ public class WallBlockingTilemap extends Tilemap { private boolean fogHidden(int cell){ if (!Dungeon.level.visited[cell] && !Dungeon.level.mapped[cell]) { return true; - } else if (wall(cell) && !wall(cell + mapWidth) && + } else if (wall(cell) && cell + mapWidth < size && !wall(cell + mapWidth) && !Dungeon.level.visited[cell + mapWidth] && !Dungeon.level.mapped[cell + mapWidth]) { return true; }