settings.c
changeset 5307 1d3295f87e8d
parent 5228 26dc9acf7d94
child 5309 3e7883483280
equal deleted inserted replaced
5306:21c3e0afe045 5307:1d3295f87e8d
  1503 	if (item == NULL) return NULL;
  1503 	if (item == NULL) return NULL;
  1504 
  1504 
  1505 	/* Loading newgrf stuff from configuration file */
  1505 	/* Loading newgrf stuff from configuration file */
  1506 	c = calloc(1, sizeof(*c));
  1506 	c = calloc(1, sizeof(*c));
  1507 	c->filename = strdup(item->name);
  1507 	c->filename = strdup(item->name);
  1508 	FillGRFDetails(c);
  1508 	if (!FillGRFDetails(c)) {
       
  1509 		ShowInfoF("ini: ignoring invalid NewGRF '%s'", c->filename);
       
  1510 		return NULL;
       
  1511 	}
  1509 
  1512 
  1510 	if (*item->value != '\0') {
  1513 	if (*item->value != '\0') {
  1511 		c->num_params = parse_intlist(item->value, (int*)c->param, lengthof(c->param));
  1514 		c->num_params = parse_intlist(item->value, (int*)c->param, lengthof(c->param));
  1512 		if (c->num_params == (byte)-1) {
  1515 		if (c->num_params == (byte)-1) {
  1513 			ShowInfoF("ini: error in array '%s'", item->name);
  1516 			ShowInfoF("ini: error in array '%s'", item->name);