From f2d72a1f60f19a7c5844c3f66d1d0b1a98a3d591 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 22 Mar 2025 16:56:10 +0100 Subject: fix bug with adding played cards to your tableau --- rules.js | 5 +++-- rules.ts | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/rules.js b/rules.js index 2ca6b70..1ccc8a3 100644 --- a/rules.js +++ b/rules.js @@ -680,9 +680,10 @@ states.add_card_to_tableau = { view.prompt = 'Add a card to your tableau.'; const faction = get_active_faction(); for (const c of game.hands[faction]) { - gen_action_card(c); + if (!game.selected_cards[faction].includes(c)) + gen_action_card(c); } - if (game.hands[faction].length === 0) { + if (game.hands[faction].length === game.selected_cards[faction].length) { gen_action('skip'); } }, diff --git a/rules.ts b/rules.ts index 52f6bea..32824b6 100644 --- a/rules.ts +++ b/rules.ts @@ -922,9 +922,10 @@ states.add_card_to_tableau = { view.prompt = 'Add a card to your tableau.'; const faction = get_active_faction(); for (const c of game.hands[faction]) { - gen_action_card(c); + if (!game.selected_cards[faction].includes(c)) + gen_action_card(c); } - if (game.hands[faction].length === 0) { + if (game.hands[faction].length === game.selected_cards[faction].length) { gen_action('skip'); } }, -- cgit v1.2.3