diff options
author | Tor Andersson <tor@ccxvii.net> | 2022-05-09 20:26:57 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-02-18 12:31:29 +0100 |
commit | 87a96e1e8b9c41a2a14c5bcd896bec92f49ece27 (patch) | |
tree | ad870f79a2c86454a2f5f314efb772a67346b289 /rules.js | |
parent | 8126ceb4758f3b78c7e84b180a5d9b07f864d16b (diff) | |
download | pax-pamir-87a96e1e8b9c41a2a14c5bcd896bec92f49ece27.tar.gz |
Only clear board after successful dominance check.
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -2644,14 +2644,9 @@ function do_dominance_check() { } // Clear the board. - for (let i = 0; i < 36; ++i) - game.pieces[i] = 0; - - // Prince Akbar Khan - if (any_player_has_insurrection()) { - log(`Insurrection placed two Afghan armies in Kabul.`); - game.pieces[0] = Kabul; - game.pieces[1] = Kabul; + if (success) { + for (let i = 0; i < 36; ++i) + game.pieces[i] = 0; } // Check instant victory @@ -2665,6 +2660,14 @@ function do_dominance_check() { game.events = {}; for (let p = 0; p < game.players.length; ++p) game.players[p].events = {}; + + // Prince Akbar Khan + if (any_player_has_insurrection()) { + // TODO: maybe move existing pieces if not successful + log(`Insurrection placed two Afghan armies in Kabul.`); + game.pieces[0] = Kabul; + game.pieces[1] = Kabul; + } } function vp_tie(pp) { |