From cee06c82db3ed7f760d6918bd6283276ba660fc8 Mon Sep 17 00:00:00 2001 From: evan Date: Tue, 22 Apr 2025 08:15:21 -0700 Subject: [PATCH] bugfix: have radial menu check canBuild when checking if boating allowed --- src/client/graphics/layers/RadialMenu.ts | 3 ++- src/core/game/PlayerImpl.ts | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/client/graphics/layers/RadialMenu.ts b/src/client/graphics/layers/RadialMenu.ts index 474bfc932..92a6377b1 100644 --- a/src/client/graphics/layers/RadialMenu.ts +++ b/src/client/graphics/layers/RadialMenu.ts @@ -380,7 +380,8 @@ export class RadialMenu implements Layer { }); } if ( - actions.buildableUnits.some((bu) => bu.type == UnitType.TransportShip) + actions.buildableUnits.find((bu) => bu.type == UnitType.TransportShip) + ?.canBuild ) { this.activateMenuElement(Slot.Boat, "#3f6ab1", boatIcon, () => { // BestTransportShipSpawn is an expensive operation, so diff --git a/src/core/game/PlayerImpl.ts b/src/core/game/PlayerImpl.ts index 09892124f..b0f889671 100644 --- a/src/core/game/PlayerImpl.ts +++ b/src/core/game/PlayerImpl.ts @@ -43,7 +43,7 @@ import { andFN, manhattanDistFN, TileRef } from "./GameMap"; import { AttackUpdate, GameUpdateType, PlayerUpdate } from "./GameUpdates"; import { TerraNulliusImpl } from "./TerraNulliusImpl"; import { - bestShoreDeploymentSource as bestTranpsortShipSpawn, + bestShoreDeploymentSource, canBuildTransportShip, } from "./TransportShipUtils"; import { UnitImpl } from "./UnitImpl"; @@ -1017,7 +1017,7 @@ export class PlayerImpl implements Player { } bestTransportShipSpawn(targetTile: TileRef): TileRef | false { - return bestTranpsortShipSpawn(this.mg, this, targetTile); + return bestShoreDeploymentSource(this.mg, this, targetTile); } // It's a probability list, so if an element appears twice it's because it's