(svn r4530) - Fix [NewGRF]: don't spew a warning when a grf file has no parameters.
authorDarkvater
Sat, 22 Apr 2006 13:59:21 +0000
changeset 3631 c6a094f0c14e
parent 3630 13278b8ed023
child 3632 0611603cc41c
(svn r4530) - Fix [NewGRF]: don't spew a warning when a grf file has no parameters.
settings.c
--- a/settings.c	Sat Apr 22 13:56:16 2006 +0000
+++ b/settings.c	Sat Apr 22 13:59:21 2006 +0000
@@ -1409,10 +1409,10 @@
 	/* Loading newgrf stuff from configuration file */
 	c = calloc(1, sizeof(*c));
 	c->filename = strdup(item->name);
-	c->num_params = parse_intlist(item->value, (int*)c->param, lengthof(c->param));
-	if (c->num_params == (byte)-1) {
-		ShowInfoF("ini: error in array '%s'", item->name);
-		c->num_params = 0;
+
+	if (*item->value != '\0') {
+		c->num_params = parse_intlist(item->value, (int*)c->param, lengthof(c->param));
+		if (c->num_params == (byte)-1) ShowInfoF("ini: error in array '%s'", item->name);
 	}
 
 	if (_first_grfconfig == NULL) {