(svn r7463) -Codechange: Don't load invalid NewGRF files from the configuration file; instead show a warning.

This commit is contained in:
peter1138 2006-12-10 10:12:54 +00:00
parent 6bc56c61e3
commit 778f97c786
1 changed files with 4 additions and 1 deletions

View File

@ -1505,7 +1505,10 @@ const char *GRFProcessParams(const IniItem *item, uint index)
/* Loading newgrf stuff from configuration file */
c = calloc(1, sizeof(*c));
c->filename = strdup(item->name);
FillGRFDetails(c);
if (!FillGRFDetails(c)) {
ShowInfoF("ini: ignoring invalid NewGRF '%s'", c->filename);
return NULL;
}
if (*item->value != '\0') {
c->num_params = parse_intlist(item->value, (int*)c->param, lengthof(c->param));