diff --git a/src/client/graphics/layers/NukeTrajectoryPreviewLayer.ts b/src/client/graphics/layers/NukeTrajectoryPreviewLayer.ts index fed84489e..447f92d87 100644 --- a/src/client/graphics/layers/NukeTrajectoryPreviewLayer.ts +++ b/src/client/graphics/layers/NukeTrajectoryPreviewLayer.ts @@ -246,12 +246,6 @@ export class NukeTrajectoryPreviewLayer implements Layer { game: this.game, targetTile, magnitude: this.game.config().nukeMagnitudes(ghostStructure), - allySmallIds: new Set( - this.game - .myPlayer() - ?.allies() - .map((a) => a.smallID()), - ), threshold: this.game.config().nukeAllianceBreakThreshold(), }); // Find the point where SAM can intercept diff --git a/src/core/execution/NukeExecution.ts b/src/core/execution/NukeExecution.ts index 9f443474f..9928be095 100644 --- a/src/core/execution/NukeExecution.ts +++ b/src/core/execution/NukeExecution.ts @@ -89,7 +89,6 @@ export class NukeExecution implements Execution { game: this.mg, targetTile: this.dst, magnitude, - allySmallIds: new Set(this.player.allies().map((a) => a.smallID())), threshold: this.mg.config().nukeAllianceBreakThreshold(), }); diff --git a/src/core/execution/Util.ts b/src/core/execution/Util.ts index aa394b343..1b51a41fe 100644 --- a/src/core/execution/Util.ts +++ b/src/core/execution/Util.ts @@ -39,7 +39,7 @@ export interface NukeAllianceCheckParams { game: Game | GameView; targetTile: TileRef; magnitude: NukeMagnitude; - allySmallIds: Set; + allySmallIds?: Set; threshold: number; } @@ -52,7 +52,7 @@ export function wouldNukeBreakAlliance( ): boolean { const { game, targetTile, magnitude, allySmallIds, threshold } = params; - if (allySmallIds.size === 0) { + if (!allySmallIds || allySmallIds.size === 0) { return false; }