equal
deleted
inserted
replaced
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 |