From bbe8ec4cde033d38d1a524ff2acc626f09f0170f Mon Sep 17 00:00:00 2001 From: evan Date: Thu, 24 Apr 2025 13:47:51 -0700 Subject: [PATCH] bfs bugfix: add the original tile to seen. this was causing single surrounded tiles to not get conquered --- src/core/game/GameMap.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/game/GameMap.ts b/src/core/game/GameMap.ts index 65c6b5bae..d450905c3 100644 --- a/src/core/game/GameMap.ts +++ b/src/core/game/GameMap.ts @@ -277,7 +277,11 @@ export class GameMapImpl implements GameMap { ): Set { const seen = new Set(); const q: TileRef[] = []; - q.push(tile); + if (filter(this, tile)) { + seen.add(tile); + q.push(tile); + } + while (q.length > 0) { const curr = q.pop(); for (const n of this.neighbors(curr)) {