summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-09-15 23:30:02 +0200
committerTor Andersson <tor@ccxvii.net>2022-11-17 13:11:27 +0100
commited3fbab5440ea95bf04d10880f178681a379ff5b (patch)
tree5186179ede213b73fe1944cbdd2964e5f2b0f653
parentecbf467fffc2678b9aef81d7875622aa7e5c0ea3 (diff)
downloadrommel-in-the-desert-ed3fbab5440ea95bf04d10880f178681a379ff5b.tar.gz
Fix movement summary flushing and reinitializing between overruns.
-rw-r--r--rules.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/rules.js b/rules.js
index a7f28fe..31e5a6c 100644
--- a/rules.js
+++ b/rules.js
@@ -2862,16 +2862,16 @@ function save_withdrawal_supply_lines() {
// ==== MOVEMENT PHASE ===
-function init_move_summary() {
- game.summary = {}
-}
-
function push_move_summary(from, to, via, forced) {
let mm = (from) | (to << 8) | (via << 16) | (forced << 24)
+ if (game.summary === null)
+ game.summary = {}
game.summary[mm] = (game.summary[mm]|0) + 1
}
function flush_move_summary() {
+ if (game.summary === null)
+ return
log_br()
if (!game.from1 && !game.from2) {
log(`Passed.`)
@@ -2925,7 +2925,6 @@ function goto_move_phase() {
set_clear(game.fired)
game.forced = []
game.state = 'select_moves'
- init_move_summary()
if (game.phasing === AXIS && game.scenario !== "1940" && game.rommel === 0)
if (game.turn_option !== 'offensive' && game.turn_option !== 'blitz')
@@ -3421,7 +3420,6 @@ states.move = {
overrun() {
push_undo()
flush_move_summary()
- init_move_summary()
game.state = 'overrun'
if (false) {