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;