From 8ea2481d40d05dbdb07a2b787d016d51f9b89959 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 1 Mar 2025 19:27:37 +0100 Subject: Fix intermittent bug with undo. --- rules.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index e068bbf..9e8cd52 100644 --- a/rules.js +++ b/rules.js @@ -79,10 +79,10 @@ function gen_spend_hero_points() { } } function action(state, player, action, arg) { - if (action !== 'undo' && state.state !== 'choose_card') { - state.undo = push_undo(); - } game = state; + if (action !== 'undo' && game.state !== 'choose_card') { + push_undo(); + } let S = states[game.state]; if (action in S) S[action](arg, player); -- cgit v1.2.3