summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rules.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/rules.js b/rules.js
index 91d848c..2dd77f5 100644
--- a/rules.js
+++ b/rules.js
@@ -3986,13 +3986,15 @@ function draw_cards(deck, democrat_hand, communist_hand, dem_hand_limit, com_han
} else if (turn === "communist" && communist_hand.length < com_hand_limit) {
communist_hand.push(draw_card(deck))
turn = "democrat"
- } else if (turn === "communist" && communist_hand.length === com_hand_limit) {
+ } else if (turn === "communist" && communist_hand.length >= com_hand_limit) {
turn = "democrat"
} else if (turn === "democrat" && democrat_hand.length < dem_hand_limit) {
democrat_hand.push(draw_card(deck))
turn = "communist"
- } else if (turn === "democrat" && democrat_hand.length === dem_hand_limit) {
+ } else if (turn === "democrat" && democrat_hand.length >= dem_hand_limit) {
turn = "communist"
+ } else {
+ throw new Error("Impossible state when drawing cards.")
}
}
clear_undo()