gcompris r3711 - in trunk: . src/boards/python
- From: bcoudoin svn gnome org
- To: svn-commits-list gnome org
- Subject: gcompris r3711 - in trunk: . src/boards/python
- Date: Fri, 30 Jan 2009 23:45:19 +0000 (UTC)
Author: bcoudoin
Date: Fri Jan 30 23:45:19 2009
New Revision: 3711
URL: http://svn.gnome.org/viewvc/gcompris?rev=3711&view=rev
Log:
Fixed crash bug when board finished.
Modified:
trunk/ChangeLog
trunk/src/boards/python/redraw.py
Modified: trunk/src/boards/python/redraw.py
==============================================================================
--- trunk/src/boards/python/redraw.py (original)
+++ trunk/src/boards/python/redraw.py Fri Jan 30 23:45:19 2009
@@ -198,9 +198,14 @@
self.erase_drawing_area()
if (self.increment_level() == 1):
self.gamewon = 1
- gcompris.bonus.display(gcompris.bonus.WIN, gcompris.bonus.FLOWER)
- self.display_current_level()
- self.root_targetitem.hide()
+ # (Quick fix) Trying to avoid a crash when board is finished
+ if self.display_current_level() == 0: # the current board is finished...
+ gcompris.bonus.board_finished(gcompris.bonus.FINISHED_RANDOM)
+ self.end()
+ else: # Level up
+ self.root_targetitem.hide()
+ gcompris.bonus.display(gcompris.bonus.WIN, gcompris.bonus.FLOWER)
+
else:
# Delete previous mark if any
@@ -286,10 +291,8 @@
i = (self.gcomprisBoard.level-1)*self.gcomprisBoard.number_of_sublevel+ \
(self.gcomprisBoard.sublevel-1)
- if(i>=len(self.drawlist)):
- # the current board is finished : bail out
- gcompris.bonus.board_finished(gcompris.bonus.FINISHED_RANDOM)
- return
+ if(i>=len(self.drawlist)): # if board is finished Only return
+ return 0
self.draw_image_target(self.drawlist[i])
@@ -331,6 +334,8 @@
# Try the next level
self.gcomprisBoard.sublevel=1
self.gcomprisBoard.level += 1
+
+
if(self.gcomprisBoard.level>self.gcomprisBoard.maxlevel) or self.gcomprisBoard.level*self.gcomprisBoard.sublevel>=len(self.drawlist):
# the current board is finished : bail out
gcompris.bonus.board_finished(gcompris.bonus.FINISHED_RANDOM)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]