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)) {