home · contact · privacy
Client: Remove superfluous line of code.
[plomrogue] / src / client / io.c
index 233a60c78043bd8e6c7de7e54c0e98eed511bcdf..6b55de932d5e179931405d1b57f77f656a569b70 100644 (file)
@@ -80,7 +80,7 @@ static uint8_t read_worldstate();
  */
 static void test_and_poll_server();
 
-/* Read queue, act on them (as of right now only: derive log messages). */
+/* Read messages from queue, act on them. */
 static uint8_t read_queue();
 
 
@@ -237,7 +237,13 @@ static uint8_t read_queue()
     while (NULL != (msg = get_message_from_queue(&world.queue)))
     {
         char * log_prefix = "LOG ";
-        if (!strncmp(msg, log_prefix, strlen(log_prefix)))
+        if (!strcmp(msg, "NEW_WORLD"))
+        {
+            ret = 1;
+            free(world.log);
+            world.log = NULL;
+        }
+        else if (!strncmp(msg, log_prefix, strlen(log_prefix)))
         {
             ret = 1;
             char * log_msg = msg + strlen(log_prefix);