summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rules.js16
1 files changed, 9 insertions, 7 deletions
diff --git a/rules.js b/rules.js
index 98d19e3..9e9087d 100644
--- a/rules.js
+++ b/rules.js
@@ -1072,13 +1072,15 @@ states.actions = {
let cost = market_cost(col, c)
let cost_per_card = cost / col
- for (let i = 0; i < col; ++i) {
- if (game.market_cards[row][i] > 0) {
- game.market_coins[row][i] += cost_per_card
- mark_card_used(game.market_cards[row][i])
- } else {
- game.market_coins[1-row][i] += cost_per_card
- mark_card_used(game.market_cards[1-row][i])
+ if (cost_per_card > 0) {
+ for (let i = 0; i < col; ++i) {
+ if (game.market_cards[row][i] > 0) {
+ game.market_coins[row][i] += cost_per_card
+ mark_card_used(game.market_cards[row][i])
+ } else {
+ game.market_coins[1-row][i] += cost_per_card
+ mark_card_used(game.market_cards[1-row][i])
+ }
}
}
check_public_withdrawal()