From 3c0a8e1fda3c627e9d8040924129bbe17a0e85ca Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Fri, 22 Mar 2013 22:34:41 +0000 Subject: [PATCH] atoms.lisp: When restoring an unstable position, continue the animation. Otherwise, the following thing goes wrong. You make a move which starts a chain reaction; you undo it before the reaction has resolved and there are still atoms from other players; and then you redo the move. At this point, you have a static board and nobody can play, since both players are :playing. --- atoms.lisp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/atoms.lisp b/atoms.lisp index 77329cf..eac69bc 100644 --- a/atoms.lisp +++ b/atoms.lisp @@ -417,7 +417,12 @@ do (restore player snap-player)) (setf (game-player-index game) (slot-value snapshot 'player-index)) (game-cancel-timeout game) - (changed game :refresh))) + (changed game :refresh) + (let ((critical-cells (loop for i below (array-total-size grid) + for cell = (row-major-aref grid i) + if (cell-critical-p cell) + collect cell))) + (when critical-cells (perform-explosions game critical-cells))))) ;;;-------------------------------------------------------------------------- ;;; The interactive board. -- 2.11.0