summaryrefslogtreecommitdiff
path: root/src/systems/grid.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/systems/grid.js')
-rw-r--r--src/systems/grid.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/systems/grid.js b/src/systems/grid.js
index 3e56ea9..6add388 100644
--- a/src/systems/grid.js
+++ b/src/systems/grid.js
@@ -26,7 +26,9 @@ game.system.Grid = (entitiesGrid) => {
}
}));
changedIds.forEach(id => {
- const entity = entities[id];
+ // TODO: Figure out why we HAVE to use game.entities rather than entities
+ // Hint: it breaks when changing a level in the menu
+ const entity = game.entities[id];
const { x, y } = entity.components.gridPosition;
entitiesGrid[y][x].set(entity.id, entity);
});