From 778f97c78650897448d9d901be2943bde99a0a45 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Sun, 10 Dec 2006 10:12:54 +0000 Subject: [PATCH] (svn r7463) -Codechange: Don't load invalid NewGRF files from the configuration file; instead show a warning. --- settings.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/settings.c b/settings.c index 39fa1e03c8..429585e026 100644 --- a/settings.c +++ b/settings.c @@ -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));