🐛 (engine) fix bug where player could buy a fifth factory

This commit is contained in:
Lucas Mello 2021-09-19 16:25:16 -03:00
commit 787dcd5722

View file

@ -171,7 +171,11 @@ export function availableMoves(G: GameState, player: Player): AvailableMoves {
}
// BuyFactory
if (player.actions > 0 && player.money >= (player.factories.length + 1) * 3) {
if (
player.actions > 0 &&
player.money >= (player.factories.length + 1) * 3 &&
player.factories.length < 4
) {
const factoriesLeft: ContainerColor[] = [];
Object.values(ContainerColor).forEach((color) => {
if (