mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-08-16 13:14:56 +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> {
|
): Set<TileRef> {
|
||||||
const seen = new Set<TileRef>();
|
const seen = new Set<TileRef>();
|
||||||
const q: TileRef[] = [];
|
const q: TileRef[] = [];
|
||||||
q.push(tile);
|
if (filter(this, tile)) {
|
||||||
|
seen.add(tile);
|
||||||
|
q.push(tile);
|
||||||
|
}
|
||||||
|
|
||||||
while (q.length > 0) {
|
while (q.length > 0) {
|
||||||
const curr = q.pop();
|
const curr = q.pop();
|
||||||
for (const n of this.neighbors(curr)) {
|
for (const n of this.neighbors(curr)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user