summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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) {