diff options
author | Tor Andersson <tor@ccxvii.net> | 2022-10-31 14:34:34 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-02-18 12:31:29 +0100 |
commit | 3b359b06d5e5460feb3eb969761094559f90c6e1 (patch) | |
tree | e0e7693f4b0545f3b65eca8af2eafc3599d6c3be | |
parent | 57a65847177425776c348da5fa82eec4afeee608 (diff) | |
download | pax-pamir-3b359b06d5e5460feb3eb969761094559f90c6e1.tar.gz |
Don't mark cards as used if you pay "0" coins to them.
-rw-r--r-- | rules.js | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -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() |