src/newgrf_config.cpp
changeset 7573 505e9d05c10a
parent 7572 817d4302228e
child 7574 40e7c5575a2a
equal deleted inserted replaced
7572:817d4302228e 7573:505e9d05c10a
   285 			GRFConfig **pd, *d;
   285 			GRFConfig **pd, *d;
   286 			bool stop = false;
   286 			bool stop = false;
   287 			for (pd = &_all_grfs; (d = *pd) != NULL; pd = &d->next) {
   287 			for (pd = &_all_grfs; (d = *pd) != NULL; pd = &d->next) {
   288 				if (c->grfid == d->grfid && memcmp(c->md5sum, d->md5sum, sizeof(c->md5sum)) == 0) added = false;
   288 				if (c->grfid == d->grfid && memcmp(c->md5sum, d->md5sum, sizeof(c->md5sum)) == 0) added = false;
   289 				/* Because there can be multiple grfs with the same name, make sure we checked all grfs with the same name,
   289 				/* Because there can be multiple grfs with the same name, make sure we checked all grfs with the same name,
   290 				*  before inserting the entry. So insert a new grf at the end of all grfs with the same name, instead of
   290 				 *  before inserting the entry. So insert a new grf at the end of all grfs with the same name, instead of
   291 				*  just after the first with the same name. Avoids doubles in the list. */
   291 				 *  just after the first with the same name. Avoids doubles in the list. */
   292 				if (strcasecmp(c->name, d->name) <= 0) stop = true;
   292 				if (strcasecmp(c->name, d->name) <= 0) stop = true;
   293 				else if (stop) break;
   293 				else if (stop) break;
   294 			}
   294 			}
   295 			if (added) {
   295 			if (added) {
   296 				c->next = d;
   296 				c->next = d;