summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-01-04 15:19:24 +0100
committerTor Andersson <tor@ccxvii.net>2022-11-16 19:19:39 +0100
commitcce959f168cf42c6def7b2c6700f7d3a03ae528c (patch)
treef6f0addcbc4383f59c2ca844972db7121b58defa
parent5e7f5119713c6c770e082a455f0a84f36744d953 (diff)
downloadcrusader-rex-cce959f168cf42c6def7b2c6700f7d3a03ae528c.tar.gz
Always push undo before changing any state.
-rw-r--r--rules.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/rules.js b/rules.js
index 38a7d4d..e28b9fa 100644
--- a/rules.js
+++ b/rules.js
@@ -1644,8 +1644,8 @@ states.move_phase = {
game.state = 'muster';
},
block: function (who) {
- game.summary = [];
push_undo();
+ game.summary = [];
game.who = who;
game.where = game.location[who];
if (game.where === GERMANIA) {
@@ -3552,9 +3552,9 @@ states.winter_replacements = {
}
},
block: function (who) {
+ push_undo();
let where = game.location[who];
let cost = replacement_cost(where);
- push_undo();
game.summary.push([where]);
game.steps[who] ++;
game.rp[where] -= cost;