M client/src/game_status/parser.rs => client/src/game_status/parser.rs +6 -1
@@ 117,10 117,15 @@ fn parse_action(action: &Action, game: &Game, game_status: &mut GameStatus) {
// pile should not be empty
assert!(pile.amount > 0);
- pile.amount -= 1;
+
+ // player should have buys
+ assert!(target.buys > 0);
// player should have enough
assert!(*for_cost <= target.currency);
+
+ pile.amount -= 1;
+ target.buys -= 1;
target.currency -= for_cost;
target.discard.push(pile.card.clone());
M client/src/plugins/game/supply/mod.rs => client/src/plugins/game/supply/mod.rs +3 -0
@@ 149,6 149,9 @@ fn handle_clicked_supply_pile(
if player.state != PlayerState::BuyPhase {
// we ain't buying rn
return;
+ } else if player.buys == 0 {
+ // not enough buys
+ return;
} else if player.currency < card.card.cost {
// not enough currency
return;