[gcompris/gcomprixo] Fix an off-by-one bug in the calculation of the amount of levels, which made it



commit 4c10289f279f221431a793b94d591212e44c4c0e
Author: Wolfram Sang <wolfram iswi org>
Date:   Fri Jun 19 23:20:04 2009 +0200

    Fix an off-by-one bug in the calculation of the amount of levels, which made it
    possible to see the end-sequence just by clicking the dice.
    
    Conflicts:
    
    	src/boards/shapegame.c

 src/babymatch-activity/shapegame.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/babymatch-activity/shapegame.c b/src/babymatch-activity/shapegame.c
index 4fa9a03..f143d92 100644
--- a/src/babymatch-activity/shapegame.c
+++ b/src/babymatch-activity/shapegame.c
@@ -264,10 +264,11 @@ static void start_board (GcomprisBoard *agcomprisBoard)
       gcomprisBoard->maxlevel=1;
       /**/
       while( (filename = gc_file_find_absolute("%s/board%d_0.xml",
-							 gcomprisBoard->boarddir,
-							 gcomprisBoard->maxlevel++,
-							 NULL)) )
+					       gcomprisBoard->boarddir,
+					       gcomprisBoard->maxlevel,
+					       NULL)) )
 	{
+	  gcomprisBoard->maxlevel++;
 	  g_free(filename);
 
 	}
@@ -1314,7 +1315,7 @@ add_shape_to_canvas(Shape *shape)
 	{
 	  shape->w = (double)gdk_pixbuf_get_width(pixmap) * shape->zoomx;
 	  shape->h = (double)gdk_pixbuf_get_height(pixmap) * shape->zoomy;
-	  
+
 	  /* Display the shape itself but hide it until the user puts the right shape on it */
 	  /* I have to do it this way for the positionning (lower/raise) complexity          */
 	  item = gnome_canvas_item_new (GNOME_CANVAS_GROUP(shape_root_item),



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