bfs bugfix: add the original tile to seen. this was causing single surrounded tiles to not get conquered

This commit is contained in:
evan
2025-04-24 13:47:51 -07:00
parent 3c586455a8
commit bbe8ec4cde
+5 -1
View File
@@ -277,7 +277,11 @@ export class GameMapImpl implements GameMap {
): Set<TileRef> {
const seen = new Set<TileRef>();
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)) {