mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 13:30:43 +00:00
This reverts commit 8124651382 which
breaks compilation, has wrong indentation and uses flatMap without
Array.from which is also wrong.
This commit is contained in:
@@ -73,12 +73,12 @@ export class BotExecution implements Execution {
|
||||
this.neighborsTerraNullius = false;
|
||||
}
|
||||
|
||||
const border = new Set(
|
||||
this.bot.borderTiles().flatMap((t) => this.mg.neighbors(t)));
|
||||
const enemies = Array.from(border).filter(
|
||||
(t) => this.mg.hasOwner(t) && this.mg.owner(t) !== this.bot);
|
||||
const border = Array.from(this.bot.borderTiles())
|
||||
.flatMap((t) => this.mg.neighbors(t))
|
||||
.filter((t) => this.mg.hasOwner(t) && this.mg.owner(t) != this.bot);
|
||||
|
||||
if (enemies.length === 0) return;
|
||||
if (border.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const toAttack = border[this.random.nextInt(0, border.length)];
|
||||
|
||||
Reference in New Issue
Block a user