diff --git a/src/core/game/PlayerImpl.ts b/src/core/game/PlayerImpl.ts index 522d2db39..181b7c361 100644 --- a/src/core/game/PlayerImpl.ts +++ b/src/core/game/PlayerImpl.ts @@ -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;