diff --git a/src/core/execution/MIRVExecution.ts b/src/core/execution/MIRVExecution.ts index dff072c8e..bdfee3b5b 100644 --- a/src/core/execution/MIRVExecution.ts +++ b/src/core/execution/MIRVExecution.ts @@ -169,10 +169,8 @@ export class MirvExecution implements Execution { if (this.mg.owner(tile) !== this.targetPlayer) { continue; } - for (const t of taken) { - if (this.mg.manhattanDist(tile, t) < 25) { - continue; - } + if (this.proximityCheck(tile, taken)) { + continue; } return tile; } @@ -180,6 +178,15 @@ export class MirvExecution implements Execution { return null; } + private proximityCheck(tile: TileRef, taken: TileRef[]): boolean { + for (const t of taken) { + if (this.mg.manhattanDist(tile, t) < 25) { + return true; + } + } + return false; + } + owner(): Player { return this.player; }