diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/DungeonTilemap.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/DungeonTilemap.java index 396fc1b8c..7eda1bcef 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/DungeonTilemap.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/DungeonTilemap.java @@ -50,24 +50,25 @@ public abstract class DungeonTilemap extends Tilemap { @Override public synchronized void updateMap() { - super.updateMap(); for (int i = 0; i < data.length; i++) data[i] = getTileVisual(i ,map[i], false); + super.updateMap(); } @Override public synchronized void updateMapCell(int cell) { //update in a 3x3 grid to account for neighbours which might also be affected if (Dungeon.level.insideMap(cell)) { + for (int i : PathFinder.NEIGHBOURS9) { + data[cell + i] = getTileVisual(cell + i, map[cell + i], false); + } super.updateMapCell(cell - mapWidth - 1); super.updateMapCell(cell + mapWidth + 1); - for (int i : PathFinder.NEIGHBOURS9) - data[cell + i] = getTileVisual(cell + i, map[cell + i], false); //unless we're at the level's edge, then just do the one tile. } else { - super.updateMapCell(cell); data[cell] = getTileVisual(cell, map[cell], false); + super.updateMapCell(cell); } } 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 1d0c31fb3..7d0c79d7d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/WallBlockingTilemap.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/tiles/WallBlockingTilemap.java @@ -46,9 +46,6 @@ public class WallBlockingTilemap extends Tilemap { @Override public synchronized void updateMap() { - super.updateMap(); - data = new int[size]; //clears all values, including cleared tiles - for (int cell = 0; cell < data.length; cell++) { //force all top/bottom row, and none-discoverable cells to cleared if (!Dungeon.level.discoverable[cell] @@ -59,6 +56,8 @@ public class WallBlockingTilemap extends Tilemap { updateMapCell(cell); } } + + super.updateMap(); } private int curr;