From 808a44e8542ebc7542d833e5a30b51b7fb8f80d5 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Thu, 7 Mar 2024 21:06:36 -0700 Subject: update assets --- src/engine/systems/Grid.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/engine/systems') diff --git a/src/engine/systems/Grid.ts b/src/engine/systems/Grid.ts index 9ab28e3..1ec8ed9 100644 --- a/src/engine/systems/Grid.ts +++ b/src/engine/systems/Grid.ts @@ -116,7 +116,12 @@ export class Grid extends System { const moving = new Set(); moving.add(entity.id); - while (!this.isOutOfBounds(nextGridPosition)) { + while (true) { + if (this.isOutOfBounds(nextGridPosition)) { + moving.clear(); + break; + } + const { x, y } = nextGridPosition; const entities = Array.from(this.grid[y][x]).map( (id) => game.getEntity(id)!, -- cgit v1.2.3-70-g09d2