summaryrefslogtreecommitdiff
path: root/settings.c
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-12-10 10:12:54 +0000
committerpeter1138 <peter1138@openttd.org>2006-12-10 10:12:54 +0000
commit4ac40e64c1dd70b442dd74c68a9c2f9e0eabda8b (patch)
tree1057be97aa54b3375d99e586bbd3e51c7535ccc0 /settings.c
parent1edad40e4e2a649f2582348293617676bb0c4641 (diff)
downloadopenttd-4ac40e64c1dd70b442dd74c68a9c2f9e0eabda8b.tar.xz
(svn r7463) -Codechange: Don't load invalid NewGRF files from the configuration file; instead show a warning.
Diffstat (limited to 'settings.c')
-rw-r--r--settings.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/settings.c b/settings.c
index 39fa1e03c..429585e02 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));