From 33818f34137e416eae318b540ffca8501e45b525 Mon Sep 17 00:00:00 2001 From: variablevince <24507472+VariableVince@users.noreply.github.com> Date: Sun, 26 Oct 2025 02:57:52 +0100 Subject: [PATCH] Reorder --- src/core/game/PlayerImpl.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/game/PlayerImpl.ts b/src/core/game/PlayerImpl.ts index 5dd3ce41b..00c99695e 100644 --- a/src/core/game/PlayerImpl.ts +++ b/src/core/game/PlayerImpl.ts @@ -885,9 +885,11 @@ export class PlayerImpl implements Player { transportShipFilter: TransportShipFilter = TransportShipFilter.Default, ): BuildableUnit[] { const inSpawnPhase = this.mg.inSpawnPhase(); + let canUpgrade: number | false = false; if (transportShipFilter === TransportShipFilter.Only) { const u = UnitType.TransportShip; + canUpgrade = !this.mg.config().unitInfo(u).upgradable ? false : 0; return [ { type: u, @@ -895,7 +897,7 @@ export class PlayerImpl implements Player { inSpawnPhase || tile === null ? false : this.canBuild(u, tile, null), - canUpgrade: !this.mg.config().unitInfo(u).upgradable ? false : 0, + canUpgrade: canUpgrade, cost: this.mg.config().unitInfo(u).cost(this), } as BuildableUnit, ]; @@ -912,7 +914,6 @@ export class PlayerImpl implements Player { continue; } - let canUpgrade: number | false = false; if (!inSpawnPhase && tile !== null) { const existingUnit = this.findUnitToUpgrade(u, tile); if (existingUnit !== false) {