diff options
Diffstat (limited to 'rules.ts')
-rw-r--r-- | rules.ts | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -172,11 +172,12 @@ export function action( action: string, arg: unknown ) { - if (action !== 'undo' && state.state !== 'choose_card') { - state.undo = push_undo(); + game = state; + + if (action !== 'undo' && game.state !== 'choose_card') { + push_undo(); } - game = state; let S = states[game.state]; if (action in S) S[action](arg, player); else if (action === 'undo' && game.undo && game.undo.length > 0) pop_undo(); |