chiark / gitweb /
atoms.lisp: When restoring an unstable position, continue the animation.
[atoms] / atoms.lisp
index 77329cf7841a466e1496bebb6d3e2d3023667cac..eac69bcee33b99290e92d60a4b00d9f5c5e8f576 100644 (file)
@@ -417,7 +417,12 @@ (defmethod restore ((game atom-game) (snapshot atom-game-snapshot))
          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.