summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2025-03-22 16:56:10 +0100
committerTor Andersson <tor@ccxvii.net>2025-03-22 16:56:10 +0100
commitf2d72a1f60f19a7c5844c3f66d1d0b1a98a3d591 (patch)
tree53e1050ed66941d82ab570acac3f807e7e1143ae
parent88a448a219b35138af7d494c74b27bbd8335acea (diff)
downloadland-and-freedom-f2d72a1f60f19a7c5844c3f66d1d0b1a98a3d591.tar.gz
fix bug with adding played cards to your tableau
-rw-r--r--rules.js5
-rw-r--r--rules.ts5
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');
}
},