mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-23 15:10:40 +00:00
bugfix: show updated cost when building a unit while another unit of same type is under construction
This commit is contained in:
@@ -6,6 +6,7 @@ import { Executor } from "./execution/ExecutionManager";
|
||||
import { WinCheckExecution } from "./execution/WinCheckExecution";
|
||||
import {
|
||||
AllPlayers,
|
||||
BuildableUnit,
|
||||
Cell,
|
||||
Game,
|
||||
GameUpdates,
|
||||
@@ -147,9 +148,13 @@ export class GameRunner {
|
||||
const actions = {
|
||||
canBoat: player.canBoat(tile),
|
||||
canAttack: player.canAttack(tile),
|
||||
buildableUnits: Object.values(UnitType).filter(
|
||||
(ut) => player.canBuild(ut, tile) != false,
|
||||
),
|
||||
buildableUnits: Object.values(UnitType).map((u) => {
|
||||
return {
|
||||
type: u,
|
||||
canBuild: player.canBuild(u, tile) != false,
|
||||
cost: this.game.config().unitInfo(u).cost(player),
|
||||
} as BuildableUnit;
|
||||
}),
|
||||
canSendEmojiAllPlayers: player.canSendEmoji(AllPlayers),
|
||||
} as PlayerActions;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user