gnome-games r7155 - trunk/aisleriot



Author: chpe
Date: Sun Jan 13 22:07:01 2008
New Revision: 7155
URL: http://svn.gnome.org/viewvc/gnome-games?rev=7155&view=rev

Log:
Enforce the constraint that no slots may be added after the game has
started by making cscmi_add_slot throw an exception in this case.


Modified:
   trunk/aisleriot/game.c

Modified: trunk/aisleriot/game.c
==============================================================================
--- trunk/aisleriot/game.c	(original)
+++ trunk/aisleriot/game.c	Sun Jan 13 22:07:01 2008
@@ -546,9 +546,9 @@
   gboolean expanded_right = FALSE;
   int expansion_depth = 0;
 
-  /* FIXMEchpe check whether this can happen; if it does, fix assumption that it doesn't in Board class. */
   if (game->state > GAME_BEGIN) {
-    g_warning ("Trying to add slot after game has started!\n");
+    scm_throw (scm_from_locale_symbol ("game-started"),
+               scm_cons (scm_from_locale_string ("Cannot add a new slot after the game has started."), SCM_EOL));
   }
 
 #ifdef HAVE_GUILE_1_8



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