From 7c10b2e9dd5d3af198635bb5cbd3f119a1730486 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 18 Sep 2022 11:13:04 +0200 Subject: Fix retreat forced march and engaging state change back to retreat move. --- rules.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/rules.js b/rules.js index 2ea7d19..f0717fb 100644 --- a/rules.js +++ b/rules.js @@ -3686,6 +3686,13 @@ function move_unit(who, to, speed, move) { } } +function resume_move() { + if (game.retreat > 0) + game.state = 'retreat_move' + else + game.state = 'move' +} + states.forced_march_via = { inactive: "movement", prompt() { @@ -3713,7 +3720,7 @@ states.forced_march_via = { forced_march_via(game.hexside.who, via, game.hexside.to, game.hexside.move) game.hexside = null - game.state = 'move' + resume_move() } } @@ -3749,7 +3756,7 @@ states.engage_via = { forced_march_via(game.hexside.who, via, game.hexside.to, game.hexside.move) game.hexside = null - game.state = 'move' + resume_move() }, hex(via) { let rommel = (game.hexside.move === game.rommel) ? 1 : 0 @@ -3760,7 +3767,7 @@ states.engage_via = { engage_via(game.hexside.who, via, game.hexside.to, game.hexside.move) game.hexside = null - game.state = 'move' + resume_move() } } -- cgit v1.2.3