changeset 5307:6ef2156aa7a5 draft

(svn r7463) -Codechange: Don't load invalid NewGRF files from the configuration file; instead show a warning.
author peter1138 <peter1138@openttd.org>
date Sun, 10 Dec 2006 10:12:54 +0000
parents 01a14eda8e3a
children 5ea9e4ffce67
files settings.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/settings.c
+++ b/settings.c
@@ -1505,7 +1505,10 @@
 	/* 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));