home · contact · privacy
Server: Fix doubling of items listed via THINGS_HERE.
authorChristian Heller <c.heller@plomlompom.de>
Sun, 7 Dec 2014 03:39:26 +0000 (04:39 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 7 Dec 2014 03:39:26 +0000 (04:39 +0100)
src/server/run.c

index 9f6afbb29f33dcc14b56acb7c997dcd7c4a29960..6f24f461d0c6d96ccf404574b8a8cc89d697dec7 100644 (file)
@@ -234,14 +234,17 @@ static uint8_t parse_command_meta(char * tok0)
                     }
                 }
             }
-            struct ThingInMemory * t_mem;
-            for (t_mem = player->t_mem; t_mem; t_mem = t_mem->next)
+            else
             {
-                if (t_mem->pos.y == atoi(tok1) && t_mem->pos.x == atoi(tok2))
+                struct ThingInMemory * t_mem;
+                for (t_mem = player->t_mem; t_mem; t_mem = t_mem->next)
                 {
-                    struct ThingType * tt = get_thing_type(t_mem->type);
-                    send_to_outfile(tt->name, 0);
-                    send_to_outfile("\n", 1);
+                    if (t_mem->pos.y == atoi(tok1) && t_mem->pos.x == atoi(tok2))
+                    {
+                        struct ThingType * tt = get_thing_type(t_mem->type);
+                        send_to_outfile(tt->name, 0);
+                        send_to_outfile("\n", 1);
+                    }
                 }
             }
             send_to_outfile("THINGS_HERE END\n", 1);