diff --git a/src/maps/double_base_usa/production.ts b/src/maps/double_base_usa/production.ts index 53df50b6..9d68eee5 100644 --- a/src/maps/double_base_usa/production.ts +++ b/src/maps/double_base_usa/production.ts @@ -15,6 +15,7 @@ import { Phase } from "../../engine/state/phase"; import { Log } from "../../engine/game/log"; import { GoodsGrowthPhase } from "../../engine/goods_growth/phase"; import { PlayerColor } from "../../engine/state/player"; +import { ActionBundle } from "../../engine/game/phase_module"; const ProductionState = z.object({ goods: GoodZod.array(), @@ -27,6 +28,7 @@ export const PRODUCTION_STATE = new Key("dbuProductionState", { export class DoubleBaseUsaSelectActionPhase extends SelectActionPhase { private readonly productionState = injectState(PRODUCTION_STATE); + private readonly currentPlayer = injectCurrentPlayer(); configureActions(): void { super.configureActions(); @@ -40,6 +42,13 @@ export class DoubleBaseUsaSelectActionPhase extends SelectActionPhase { this.productionState.delete(); super.onEnd(); } + forcedAction(): ActionBundle | undefined { + // If the current player has already selected an action (i.e. production) do not force an action + if (this.currentPlayer().selectedAction !== undefined) { + return undefined; + } + return super.forcedAction(); + } } export const ProductionData = z.object({ diff --git a/src/maps/eastern_us_and_canada/production.ts b/src/maps/eastern_us_and_canada/production.ts index 76b57e93..c4cbb3a4 100644 --- a/src/maps/eastern_us_and_canada/production.ts +++ b/src/maps/eastern_us_and_canada/production.ts @@ -17,6 +17,7 @@ import { Phase } from "../../engine/state/phase"; import { Log } from "../../engine/game/log"; import { GoodsGrowthPhase } from "../../engine/goods_growth/phase"; import { PlayerColor } from "../../engine/state/player"; +import { ActionBundle } from "../../engine/game/phase_module"; const ProductionState = z.object({ goods: GoodZod.array(), @@ -30,6 +31,7 @@ export const PRODUCTION_STATE = new Key("eucProductionState", { export class EasternUsAndCanadaSelectActionPhase extends SelectActionPhase { private readonly productionState = injectState(PRODUCTION_STATE); + private readonly currentPlayer = injectCurrentPlayer(); configureActions(): void { super.configureActions(); @@ -43,6 +45,13 @@ export class EasternUsAndCanadaSelectActionPhase extends SelectActionPhase { this.productionState.delete(); super.onEnd(); } + forcedAction(): ActionBundle | undefined { + // If the current player has already selected an action (i.e. production) do not force an action + if (this.currentPlayer().selectedAction !== undefined) { + return undefined; + } + return super.forcedAction(); + } } export class EasternUsAndCanadaSelectAction extends SelectAction {