From: Mark Wooding Date: Fri, 22 Mar 2013 22:52:52 +0000 (+0000) Subject: atoms.lisp: Fix undo/redo action sensitivity. X-Git-Url: https://git.distorted.org.uk/~mdw/atoms/commitdiff_plain/99667eae214f13e3af48adac7dc300ca6c4a7a9d?hp=3c0a8e1fda3c627e9d8040924129bbe17a0e85ca atoms.lisp: Fix undo/redo action sensitivity. Undo should be available after the first turn, but wasn't. The reason is twofold: * `update-undo-redo-sensitivity' was hooked onto :processing-move rather than :start-turn, which was just a mistake, though it seemed not to be because the order of the notifications was wrong; and * `perform-explosions', which is where :start-turn is issued, was being called before the undo record was laid down, whereas it should always have been afterwards. --- diff --git a/atoms.lisp b/atoms.lisp index eac69bc..af9a21c 100644 --- a/atoms.lisp +++ b/atoms.lisp @@ -362,8 +362,8 @@ (unless (cell-played cell player-index) (return-from escape)) (setf (player-state player) :playing) - (changed game :processing-move) - (perform-explosions game (list cell))))))) + (changed game :processing-move)) + (perform-explosions game (list cell)))))) (defmethod restart-game ((game atom-game) &key grid players) (game-cancel-timeout game) @@ -1010,7 +1010,7 @@ (defmethod notify progn ((window atom-game-window) (game atom-game) aspect &key) (case aspect - ((:undo :redo :refresh :processing-move) + ((:undo :redo :refresh :start-turn) (update-undo-redo-sensitivity window)))) (defun action-undo (window)