mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-08-18 09:14:09 +00:00
bugfix: have radial menu check canBuild when checking if boating allowed
This commit is contained in:
@@ -380,7 +380,8 @@ export class RadialMenu implements Layer {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
actions.buildableUnits.some((bu) => bu.type == UnitType.TransportShip)
|
actions.buildableUnits.find((bu) => bu.type == UnitType.TransportShip)
|
||||||
|
?.canBuild
|
||||||
) {
|
) {
|
||||||
this.activateMenuElement(Slot.Boat, "#3f6ab1", boatIcon, () => {
|
this.activateMenuElement(Slot.Boat, "#3f6ab1", boatIcon, () => {
|
||||||
// BestTransportShipSpawn is an expensive operation, so
|
// BestTransportShipSpawn is an expensive operation, so
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ import { andFN, manhattanDistFN, TileRef } from "./GameMap";
|
|||||||
import { AttackUpdate, GameUpdateType, PlayerUpdate } from "./GameUpdates";
|
import { AttackUpdate, GameUpdateType, PlayerUpdate } from "./GameUpdates";
|
||||||
import { TerraNulliusImpl } from "./TerraNulliusImpl";
|
import { TerraNulliusImpl } from "./TerraNulliusImpl";
|
||||||
import {
|
import {
|
||||||
bestShoreDeploymentSource as bestTranpsortShipSpawn,
|
bestShoreDeploymentSource,
|
||||||
canBuildTransportShip,
|
canBuildTransportShip,
|
||||||
} from "./TransportShipUtils";
|
} from "./TransportShipUtils";
|
||||||
import { UnitImpl } from "./UnitImpl";
|
import { UnitImpl } from "./UnitImpl";
|
||||||
@@ -1017,7 +1017,7 @@ export class PlayerImpl implements Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bestTransportShipSpawn(targetTile: TileRef): TileRef | false {
|
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
|
// It's a probability list, so if an element appears twice it's because it's
|
||||||
|
|||||||
Reference in New Issue
Block a user