summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-07-08 11:43:18 +0200
committerTor Andersson <tor@ccxvii.net>2023-07-08 11:43:18 +0200
commitd38c18e2107bce8f6ff66daf778662f5524f989b (patch)
tree9bc7f2712da610aaba7c13f4b1ef6785e238e1fa /rules.js
parent3b5d93cf0152bcc103f7260519d540cf0997867d (diff)
downloadtime-of-crisis-d38c18e2107bce8f6ff66daf778662f5524f989b.tar.gz
Fix end game turn skipping (discard cards).
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/rules.js b/rules.js
index b17bbd8..030206c 100644
--- a/rules.js
+++ b/rules.js
@@ -4776,12 +4776,17 @@ function goto_buy_trash_discard() {
else
log("Played no cards.")
- if (game.end)
+ if (game.end) {
+ // Skip rest of turn...
+ for (let c of game.played)
+ set_add(discard, c)
+ game.played.length = 0
goto_end_of_turn()
- else if (current_hand().length > 0)
+ } else if (current_hand().length > 0) {
game.state = "buy_trash_discard"
- else
+ } else {
goto_buy_trash()
+ }
}
states.buy_trash_discard = {
@@ -5090,8 +5095,6 @@ function vp_tie(p) {
function goto_game_end() {
log_h1("Game End")
- game.played.length = 0
-
game.crisis[0] = -1
game.crisis[1] = 0
game.crisis[2] = 0