This commit is contained in:
variablevince
2025-10-26 10:27:13 +01:00
parent bafe4e3b17
commit 75ed62a3b3
+10 -4
View File
@@ -903,6 +903,7 @@ export class PlayerImpl implements Player {
transportShipFilter?: TransportShipFilter,
): BuildableUnit[] {
const notInSpawnPhase = !this.mg.inSpawnPhase();
let foundShip = false;
const result: BuildableUnit[] = [];
const validTiles =
@@ -912,14 +913,19 @@ export class PlayerImpl implements Player {
for (const u of Object.values(UnitType)) {
if (
(u === UnitType.TransportShip &&
transportShipFilter === TransportShipFilter.Exclude) ||
(u !== UnitType.TransportShip &&
transportShipFilter === TransportShipFilter.Only)
u === UnitType.TransportShip &&
transportShipFilter === TransportShipFilter.Exclude
) {
continue;
}
if (transportShipFilter === TransportShipFilter.Only) {
if (foundShip) break;
if (u !== UnitType.TransportShip) continue;
else foundShip = true;
}
let canBuild: TileRef | false = false;
let canUpgrade: number | false = false;