summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-09-18 11:13:04 +0200
committerTor Andersson <tor@ccxvii.net>2022-11-17 13:11:27 +0100
commit7c10b2e9dd5d3af198635bb5cbd3f119a1730486 (patch)
treeeb5ffacc63d7636020c05d57b64c40db02009694
parent620f03818f45aaadf283e554677bec8300836945 (diff)
downloadrommel-in-the-desert-7c10b2e9dd5d3af198635bb5cbd3f119a1730486.tar.gz
Fix retreat forced march and engaging state change back to retreat move.
-rw-r--r--rules.js13
1 files 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()
}
}