mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 12:51:30 +00:00
bfs bugfix: add the original tile to seen. this was causing single surrounded tiles to not get conquered
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user