(svn r18813) -Codechange: deduplicate copying a newgrf config

This commit is contained in:
yexo
2010-01-15 18:28:30 +00:00
parent aaf0b4b46c
commit bd102b78ee
3 changed files with 29 additions and 23 deletions

View File

@@ -381,12 +381,7 @@ public:
}
/* Copy GRF details from scanned list */
GRFConfig *c = CallocT<GRFConfig>(1);
*c = *src;
c->filename = strdup(src->filename);
if (src->name != NULL) c->name = strdup(src->name);
if (src->info != NULL) c->info = strdup(src->info);
c->next = NULL;
GRFConfig *c = DuplicateGRFConfig(src);
/* Append GRF config to configuration list */
*list = c;