From: Christian Heller Date: Sun, 7 Dec 2014 03:39:26 +0000 (+0100) Subject: Server: Fix doubling of items listed via THINGS_HERE. X-Git-Tag: tce~564 X-Git-Url: https://plomlompom.com/repos/%22https:/validator.w3.org/%7B%7Bprefix%7D%7D/processes?a=commitdiff_plain;h=b9c39db08e6187cc33ae9f308118249a5a33ba64;p=plomrogue Server: Fix doubling of items listed via THINGS_HERE. --- diff --git a/src/server/run.c b/src/server/run.c index 9f6afbb..6f24f46 100644 --- a/src/server/run.c +++ b/src/server/run.c @@ -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);