From ec225671fdd3608b5523fbf70d7512fc3a05806b Mon Sep 17 00:00:00 2001 From: Restart2008 Date: Sat, 25 Oct 2025 20:58:07 -0700 Subject: [PATCH] Fix: Resolve deployment failure due to euclideanDist Corrected the usage of distance calculation in MIRVExecution.ts. Previously, euclideanDist was called on the Game object, which does not exist. Changed to use Math.sqrt(this.mg.euclideanDistSquared()) which is the correct method. This resolves the TS2339: Property 'euclideanDist' does not exist on type 'Game'. error that caused the deployment to fail. --- src/core/execution/MIRVExecution.ts | 5 +++-- tests/core/executions/MIRVExecution.test.ts | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core/execution/MIRVExecution.ts b/src/core/execution/MIRVExecution.ts index e1d085745..b532164b3 100644 --- a/src/core/execution/MIRVExecution.ts +++ b/src/core/execution/MIRVExecution.ts @@ -45,7 +45,6 @@ export class MirvExecution implements Execution { this.pathFinder = new ParabolaPathFinder(mg); this.targetPlayer = this.mg.owner(this.dst); - // Record stats this.mg.stats().bombLaunch(this.player, this.targetPlayer, UnitType.MIRV); @@ -77,7 +76,9 @@ export class MirvExecution implements Execution { this.separateDst = this.mg.ref(x, y); this.pathFinder.computeControlPoints(spawn, this.separateDst); // Calculate speed for fixed travel time - const distance = this.mg.euclideanDist(spawn, this.separateDst); + const distance = Math.sqrt( + this.mg.euclideanDistSquared(spawn, this.separateDst), + ); this.speed = distance / this.MIRV_FIXED_TRAVEL_TIME; this.mg.displayIncomingUnit( diff --git a/tests/core/executions/MIRVExecution.test.ts b/tests/core/executions/MIRVExecution.test.ts index 8186d949c..12370abe0 100644 --- a/tests/core/executions/MIRVExecution.test.ts +++ b/tests/core/executions/MIRVExecution.test.ts @@ -7,9 +7,9 @@ import { PlayerType, UnitType, } from "../../../src/core/game/Game"; -import { TileRef } from "../../../src/core/game/GameMap"; + import { setup } from "../../util/Setup"; -import { constructionExecution, executeTicks } from "../../util/utils"; +import { constructionExecution } from "../../util/utils"; let game: Game; let player: Player;