diff --git a/moonlight/src/GameStates.js b/moonlight/src/GameStates.js index e1b4078..9bf9adf 100644 --- a/moonlight/src/GameStates.js +++ b/moonlight/src/GameStates.js @@ -61,6 +61,14 @@ GameState.prototype.create = function() } } + this.map_collision_layers.forEach(function(layer) { + layer.layer.data.forEach(function(row) { + row.forEach(function(column) { + setTileProperties(column); + }, this); + }, this); + }, this); + pathfinder_grid = new PF.Grid(this.map.width, this.map.height, pfgrid); diff --git a/moonlight/src/Util.js b/moonlight/src/Util.js index 6846339..4bbe9ed 100644 --- a/moonlight/src/Util.js +++ b/moonlight/src/Util.js @@ -347,7 +347,6 @@ function tilesFromCollisionLayers(x, y) var res = []; layers.forEach(function(layer) { var tile = layer.getTiles(x, y, 1, 1)[0]; - setTileProperties(tile); res.push(tile); }, this); return res;