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.
This commit is contained in:
Restart2008
2025-10-25 20:58:07 -07:00
parent 4d924ef8d1
commit ec225671fd
2 changed files with 5 additions and 4 deletions
+3 -2
View File
@@ -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(
+2 -2
View File
@@ -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;