gnome-games r9046 - trunk/aisleriot



Author: vpovirk
Date: Mon Apr 13 05:09:04 2009
New Revision: 9046
URL: http://svn.gnome.org/viewvc/gnome-games?rev=9046&view=rev

Log:
aisleriot: do not increment the flip counter if the stock and waste are empty

flip-stock returns #f in this case; therefore, it should not change the
game state.

This fixes test failures in many games (see bug 569936).


Modified:
   trunk/aisleriot/sol.scm

Modified: trunk/aisleriot/sol.scm
==============================================================================
--- trunk/aisleriot/sol.scm	(original)
+++ trunk/aisleriot/sol.scm	Mon Apr 13 05:09:04 2009
@@ -242,7 +242,8 @@
 ; If the flip limit is negative, it is treated as infinite.
 (define (flip-stock stock-slot waste-slot flip-limit . rest)
   (if (empty-slot? stock-slot)
-      (and (or (< flip-limit 0)
+      (and (not (empty-slot? waste-slot))
+           (or (< flip-limit 0)
 	       (< FLIP-COUNTER flip-limit))
 	   (set! FLIP-COUNTER (+ 1 FLIP-COUNTER))
 	   (flip-deck stock-slot waste-slot))



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]