[Tux4kids-commits] r1474 - tuxmath/branches/lan/src

David Bruce dbruce-guest at alioth.debian.org
Tue Sep 1 14:18:18 UTC 2009


Author: dbruce-guest
Date: 2009-09-01 14:18:17 +0000 (Tue, 01 Sep 2009)
New Revision: 1474

Modified:
   tuxmath/branches/lan/src/game.c
Log:
fix of comet removal in LAN game


Modified: tuxmath/branches/lan/src/game.c
===================================================================
--- tuxmath/branches/lan/src/game.c	2009-09-01 06:26:38 UTC (rev 1473)
+++ tuxmath/branches/lan/src/game.c	2009-09-01 14:18:17 UTC (rev 1474)
@@ -15,7 +15,7 @@
   August 26, 2001 - February 18, 2004
 
   Revised by David Bruce, Tim Holy and others
-  2005-2007
+  2005-2009
 */
 
 #define TUXMATH_DEBUG
@@ -565,13 +565,19 @@
   if(id < 1)  // The question_id can never be negative or zero
     return 0;
 
+  comet_screen = finder(id);
   fc = find_comet_by_id(id);
-  comet_screen = finder(id);
-  if(!fc)
+  if(!comet_screen && !fc)
     return 0;
 
-  erase_flashcard(fc);
-  erase_comet_on_screen(comet_screen);
+  if(comet_screen)
+    erase_comet_on_screen(comet_screen);
+
+  //NOTE: normally the question should no longer be in the queue,
+  //so the next statement should not be needed:
+  if(fc)
+    erase_flashcard(fc);
+
   return 1;
 }
 




More information about the Tux4kids-commits mailing list