[Tux4kids-commits] r1297 - tuxmath/branches/lan/src
David Bruce
dbruce-guest at alioth.debian.org
Fri Jul 31 00:18:52 UTC 2009
Author: dbruce-guest
Date: 2009-07-31 00:18:52 +0000 (Fri, 31 Jul 2009)
New Revision: 1297
Modified:
tuxmath/branches/lan/src/game.c
tuxmath/branches/lan/src/mathcards.c
Log:
small check for invalid question matching
Modified: tuxmath/branches/lan/src/game.c
===================================================================
--- tuxmath/branches/lan/src/game.c 2009-07-30 20:38:16 UTC (rev 1296)
+++ tuxmath/branches/lan/src/game.c 2009-07-31 00:18:52 UTC (rev 1297)
@@ -573,8 +573,11 @@
return 0;
id = atoi(p);
+ if(id == 0) // The question_id can never be zero, and will falsely match blank comets
+ return 0;
+
fc = find_comet_by_id(id);
- comet_screen=finder(id);
+ comet_screen = finder(id);
if(!fc)
return 0;
Modified: tuxmath/branches/lan/src/mathcards.c
===================================================================
--- tuxmath/branches/lan/src/mathcards.c 2009-07-30 20:38:16 UTC (rev 1296)
+++ tuxmath/branches/lan/src/mathcards.c 2009-07-31 00:18:52 UTC (rev 1297)
@@ -2237,6 +2237,7 @@
strncpy(fc->answer_string, " ", MC_ANSWER_LEN);
fc->answer = 0;
fc->difficulty = 0;
+ fc->question_id = -1;
}
int MC_FlashCardGood(const MC_FlashCard* fc)
More information about the Tux4kids-commits
mailing list