summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2021-05-06 18:51:30 +0200
committerTor Andersson <tor@ccxvii.net>2022-11-16 19:12:55 +0100
commitaebba0da75ef4ace08079a39ebde51234be6fb80 (patch)
tree03f4549d6d47362070b62e2acda3056a53710833
parentb6af8b17db4cf325069fd22bb3dbdd607e3754b8 (diff)
downloadrichard-iii-aebba0da75ef4ace08079a39ebde51234be6fb80.tar.gz
richard: Fix undo when mustering.
-rw-r--r--rules.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/rules.js b/rules.js
index f4340ea..99376e9 100644
--- a/rules.js
+++ b/rules.js
@@ -1548,6 +1548,7 @@ states.muster_event = {
}
},
area: function (where) {
+ push_undo();
game.where = where;
game.state = 'muster_who';
},
@@ -1571,6 +1572,7 @@ states.muster_who = {
gen_action(view, 'block', b);
},
block: function (who) {
+ push_undo();
game.who = who;
game.state = 'muster_move_1';
},
@@ -1596,10 +1598,6 @@ states.muster_move_1 = {
gen_action(view, 'area', to);
}
},
- block: function () {
- game.who = null;
- game.state = 'muster_who';
- },
area: function (to) {
let from = game.location[game.who];
log_move_start(from);
@@ -1614,6 +1612,7 @@ states.muster_move_1 = {
game.state = 'muster_move_2';
}
},
+ block: pop_undo,
undo: pop_undo,
}