From 3b359b06d5e5460feb3eb969761094559f90c6e1 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 31 Oct 2022 14:34:34 +0100 Subject: Don't mark cards as used if you pay "0" coins to them. --- rules.js | 16 +++++++++------- 1 file 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() -- cgit v1.2.3