diff options
author | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2024-03-07 21:06:36 -0700 |
---|---|---|
committer | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2024-03-07 21:06:36 -0700 |
commit | 808a44e8542ebc7542d833e5a30b51b7fb8f80d5 (patch) | |
tree | 8351c1fd039053e64a3491b8ae8220e0584ab553 /src/engine/systems | |
parent | e6e29440563e33bb67e0ad51f9fb6c5c2c3fe809 (diff) | |
download | the-abstraction-engine-808a44e8542ebc7542d833e5a30b51b7fb8f80d5.tar.gz the-abstraction-engine-808a44e8542ebc7542d833e5a30b51b7fb8f80d5.zip |
update assets
Diffstat (limited to 'src/engine/systems')
-rw-r--r-- | src/engine/systems/Grid.ts | 7 |
1 files changed, 6 insertions, 1 deletions
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<string>(); 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)!, |