summaryrefslogtreecommitdiff
path: root/rules.ts
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2025-03-22 16:11:41 +0100
committerTor Andersson <tor@ccxvii.net>2025-03-22 16:11:51 +0100
commitf83ef7dae8b8934aa4bf536757439b3f1f7f55b0 (patch)
treecd2fb408613a05cde5271e72ca0390db27045c01 /rules.ts
parent6fc07d9638e6fba8b0750201ab8d400d5e1754ed (diff)
downloadland-and-freedom-f83ef7dae8b8934aa4bf536757439b3f1f7f55b0.tar.gz
fix off by one in swap_card_tableau_hand
Diffstat (limited to 'rules.ts')
-rw-r--r--rules.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/rules.ts b/rules.ts
index 2698106..9c5be20 100644
--- a/rules.ts
+++ b/rules.ts
@@ -2302,10 +2302,10 @@ states.swap_card_tableau_hand = {
if (selected_cards.length === selected_at_start + 2) {
const hand = game.hands[faction];
const tableau = game.tableaus[faction];
- array_remove_item(hand, selected_cards[selected_at_start + 1]);
- array_remove_item(tableau, selected_cards[selected_at_start + 2]);
- hand.push(selected_cards[selected_at_start + 2]);
- tableau.push(selected_cards[selected_at_start + 1]);
+ array_remove_item(hand, selected_cards[selected_at_start + 0]);
+ array_remove_item(tableau, selected_cards[selected_at_start + 1]);
+ hand.push(selected_cards[selected_at_start + 1]);
+ tableau.push(selected_cards[selected_at_start + 0]);
game.selected_cards[faction].length = selected_at_start;
resolve_active_and_proceed();
}