[Tux4kids-commits] r1296 - in tuxmath/branches/lan: server src

David Bruce dbruce-guest at alioth.debian.org
Thu Jul 30 20:38:16 UTC 2009


Author: dbruce-guest
Date: 2009-07-30 20:38:16 +0000 (Thu, 30 Jul 2009)
New Revision: 1296

Modified:
   tuxmath/branches/lan/server/server.c
   tuxmath/branches/lan/src/game.c
   tuxmath/branches/lan/src/mathcards.h
Log:
added "comet_counter = 0" to reset_comets().



Modified: tuxmath/branches/lan/server/server.c
===================================================================
--- tuxmath/branches/lan/server/server.c	2009-07-30 16:23:36 UTC (rev 1295)
+++ tuxmath/branches/lan/server/server.c	2009-07-30 20:38:16 UTC (rev 1296)
@@ -84,7 +84,7 @@
 UDPsocket udpsock = NULL;     /* Used to listen for client's server autodetection           */
 TCPsocket server_sock = NULL; /* Socket descriptor for server to accept client TCP sockets. */
 IPaddress ip;
-SDLNet_SocketSet client_set = NULL, temp_sock = NULL, temp_set = NULL;
+SDLNet_SocketSet client_set = NULL, temp_set = NULL;
 static client_type client[MAX_CLIENTS];
 static int num_clients = 0;
 static int numready = 0;

Modified: tuxmath/branches/lan/src/game.c
===================================================================
--- tuxmath/branches/lan/src/game.c	2009-07-30 16:23:36 UTC (rev 1295)
+++ tuxmath/branches/lan/src/game.c	2009-07-30 20:38:16 UTC (rev 1296)
@@ -141,7 +141,7 @@
 /*****************************************************************/
 MC_FlashCard comets_questions[TEST_COMETS];    //current questions
 int remaining_quests = 0;
-static int comet_counter=0;
+static int comet_counter = 0;
 /****************************************************************/
 typedef struct {
   int x_is_blinking;
@@ -2810,7 +2810,7 @@
    /* time we happen to need it to make a new comet. So I'm commenting out        */
    /* the 'say_to_server()' call as well - DSB                                     */
 #ifdef HAVE_LIBSDL_NET
-    for (comet_counter;comet_counter<TEST_COMETS;comet_counter++)
+    for (comet_counter; comet_counter < TEST_COMETS; comet_counter++)
      {
        if(comets_questions[comet_counter].question_id!=-1){
         copy_card(&(comets_questions[comet_counter]),&(comets[found].flashcard)); //will be replaced on set up of new system
@@ -2818,7 +2818,7 @@
         break;}
      }
      if(comet_counter==TEST_COMETS)
-       comet_counter=0;
+       comet_counter = 0;
 #endif
      /* If we make it to here, create a new comet!*/
      comets[found].answer = comets[found].flashcard.answer;
@@ -3635,7 +3635,9 @@
 
 void reset_comets(void)
 {
-  int i =0;
+  int i = 0;
+  comet_counter = 0;
+
   for (i = 0; i < MAX_COMETS; i++)
   {
     comets[i].alive = 0;

Modified: tuxmath/branches/lan/src/mathcards.h
===================================================================
--- tuxmath/branches/lan/src/mathcards.h	2009-07-30 16:23:36 UTC (rev 1295)
+++ tuxmath/branches/lan/src/mathcards.h	2009-07-30 20:38:16 UTC (rev 1296)
@@ -147,6 +147,10 @@
 //#define DEFAULT_FRACTION_TO_KEEP 1
 
 
+/* FIXME I think this array-based options system is *much* more error-prone */
+/* and confusing than the old struct with a named field for each option,    */
+/* albeit more compact. I think it would be worth the effort to change the  */
+/* code back to the old system - DSB                                        */
 typedef struct _MC_Options
 {
   int iopts[NOPTS];




More information about the Tux4kids-commits mailing list