Wall gen screen w/h ratio and clearWalls null fix

This commit is contained in:
M4YX0R
2021-12-11 11:29:56 +03:00
parent 95cf6b90b4
commit 224ab1728c
2 changed files with 7 additions and 3 deletions

View File

@@ -104,7 +104,8 @@ class WorldEnvironment extends Environment{
clearWalls() {
for(var wall of this.walls){
if (this.grid_map.cellAt(wall.col, wall.row).state == CellStates.wall)
var wcell = this.grid_map.cellAt(wall.col, wall.row);
if (wcell && wcell.state == CellStates.wall)
this.changeCell(wall.col, wall.row, CellStates.empty, null);
}
}