summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-02-24 17:59:50 +0100
committerTor Andersson <tor@ccxvii.net>2024-02-24 17:59:50 +0100
commit29e0524e7122ec48a7250bd1d7ff58c5c149191b (patch)
tree8166eb5a5c1cca2e1f8b9d0ed45b290cc15c1079
parent044c1e8915aa24f81800dafc8cc105fbb17ba5fa (diff)
downloadpax-pamir-29e0524e7122ec48a7250bd1d7ff58c5c149191b.tar.gz
Don't clear board if dominance check ends the game.
-rw-r--r--rules.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/rules.js b/rules.js
index 69025e2..b695195 100644
--- a/rules.js
+++ b/rules.js
@@ -3003,12 +3003,6 @@ function do_dominance_check(reason) {
assign_vp([3, 1], score, score.slice())
}
- // Clear the board.
- if (success) {
- for (let i = 0; i < 36; ++i)
- game.pieces[i] = 0
- }
-
// Check instant victory
let vps = game.players.map(pp => pp.vp).sort((a,b)=>b-a)
if (vps[0] >= vps[1] + 4)
@@ -3017,6 +3011,12 @@ function do_dominance_check(reason) {
if (final)
return goto_pause_game_over()
+ // Clear the board.
+ if (success) {
+ for (let i = 0; i < 36; ++i)
+ game.pieces[i] = 0
+ }
+
game.events = {}
for (let p = 0; p < game.players.length; ++p)
game.players[p].events = {}