(svn r7463) -Codechange: Don't load invalid NewGRF files from the configuration file; instead show a warning.
authorpeter1138
Sun, 10 Dec 2006 10:12:54 +0000
changeset 5307 1d3295f87e8d
parent 5306 21c3e0afe045
child 5308 990a4b188233
(svn r7463) -Codechange: Don't load invalid NewGRF files from the configuration file; instead show a warning.
settings.c
--- a/settings.c	Sun Dec 10 00:48:50 2006 +0000
+++ b/settings.c	Sun Dec 10 10:12:54 2006 +0000
@@ -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));