v0.4.3: fixed bugs with dungeon tile map
This commit is contained in:
parent
017ab991fa
commit
b67d84e7da
|
@ -173,12 +173,18 @@ public class DungeonTilemap extends Tilemap {
|
|||
|
||||
@Override
|
||||
public synchronized void updateMapCell(int cell) {
|
||||
//update in a 3x3 grid to accound for neighbours which might also be affected
|
||||
super.updateMapCell(Math.max( 0, cell - mapWidth - 1));
|
||||
super.updateMapCell(Math.min( size-1, cell + mapWidth + 1));
|
||||
//update in a 3x3 grid to account for neighbours which might also be affected
|
||||
if (Dungeon.level.insideMap(cell)) {
|
||||
super.updateMapCell(cell - mapWidth - 1);
|
||||
super.updateMapCell(cell + mapWidth + 1);
|
||||
for (int i : PathFinder.NEIGHBOURS9)
|
||||
if (cell+i >= 0 && cell+i <= 1023)
|
||||
data[cell+i] = getTileVisual(cell+i, map[cell+i]);
|
||||
data[cell + i] = getTileVisual(cell + i, map[cell + i]);
|
||||
|
||||
//unless we're at the level's edge, then just do the one tile.
|
||||
} else {
|
||||
super.updateMapCell(cell);
|
||||
data[cell] = getTileVisual(cell, map[cell]);
|
||||
}
|
||||
}
|
||||
|
||||
private int getTileVisual(int pos, int tile){
|
||||
|
|
Loading…
Reference in New Issue
Block a user