This commit is contained in:
variablevince
2025-10-26 02:57:52 +01:00
parent 6e39f21662
commit 33818f3413
+3 -2
View File
@@ -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) {