v0.4.3: fixed dungeon tile map occasionaly causing crashes
This commit is contained in:
parent
450804e884
commit
46be732d44
|
@ -174,9 +174,10 @@ public class DungeonTilemap extends Tilemap {
|
||||||
@Override
|
@Override
|
||||||
public synchronized void updateMapCell(int cell) {
|
public synchronized void updateMapCell(int cell) {
|
||||||
//update in a 3x3 grid to accound for neighbours which might also be affected
|
//update in a 3x3 grid to accound for neighbours which might also be affected
|
||||||
super.updateMapCell(cell - mapWidth - 1);
|
super.updateMapCell(Math.max( 0, cell - mapWidth - 1));
|
||||||
super.updateMapCell(cell + mapWidth + 1);
|
super.updateMapCell(Math.min( size-1, cell + mapWidth + 1));
|
||||||
for (int i : PathFinder.NEIGHBOURS9)
|
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]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user