station_gui.c
changeset 5247 c3eece01af11
parent 5128 c75525088fb9
child 5271 419c6746fd90
equal deleted inserted replaced
5246:29224c621fd6 5247:c3eece01af11
   180 	const Station *st;
   180 	const Station *st;
   181 
   181 
   182 	if (!(sl->flags & SL_REBUILD)) return;
   182 	if (!(sl->flags & SL_REBUILD)) return;
   183 
   183 
   184 	/* Create array for sorting */
   184 	/* Create array for sorting */
   185 	station_sort = malloc(GetStationArraySize() * sizeof(station_sort[0]));
   185 	station_sort = malloc((GetMaxStationIndex() + 1) * sizeof(station_sort[0]));
   186 	if (station_sort == NULL)
   186 	if (station_sort == NULL)
   187 		error("Could not allocate memory for the station-sorting-list");
   187 		error("Could not allocate memory for the station-sorting-list");
   188 
   188 
   189 	DEBUG(misc, 1) ("Building station list for player %d...", owner);
   189 	DEBUG(misc, 1) ("Building station list for player %d...", owner);
   190 
   190