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



commit 17e1ae7854b468b6ed1d89809de1159c993c2291
Author: Wolfram Sang <wolfram iswi org>
Date:   Fri Jun 19 00:14:02 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.

 src/boards/shapegame.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/src/boards/shapegame.c b/src/boards/shapegame.c
index e27bed8..d6e69f4 100644
--- a/src/boards/shapegame.c
+++ b/src/boards/shapegame.c
@@ -261,14 +261,12 @@ static void start_board (GcomprisBoard *agcomprisBoard)
       /**/
       while( (filename = gc_file_find_absolute("%s/board%d_0.xml",
 							 gcomprisBoard->boarddir,
-							 gcomprisBoard->maxlevel++,
+							 gcomprisBoard->maxlevel,
 							 NULL)) )
 	{
+	  gcomprisBoard->maxlevel++;
 	  g_free(filename);
-
 	}
-
-      /**/
       gcomprisBoard->maxlevel--;
 
       gc_bar_set(GC_BAR_CONFIG|GC_BAR_LEVEL);



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