@ -137,6 +137,9 @@ void SetCustomStationSpec(StationSpec *statspec)
StationClass * station_class ;
StationClass * station_class ;
int i ;
int i ;
/* If the station has already been allocated, don't reallocate it. */
if ( statspec - > allocated ) return ;
assert ( statspec - > sclass < STAT_CLASS_MAX ) ;
assert ( statspec - > sclass < STAT_CLASS_MAX ) ;
station_class = & station_classes [ statspec - > sclass ] ;
station_class = & station_classes [ statspec - > sclass ] ;
@ -144,6 +147,7 @@ void SetCustomStationSpec(StationSpec *statspec)
station_class - > spec = realloc ( station_class - > spec , station_class - > stations * sizeof ( * station_class - > spec ) ) ;
station_class - > spec = realloc ( station_class - > spec , station_class - > stations * sizeof ( * station_class - > spec ) ) ;
station_class - > spec [ i ] = statspec ;
station_class - > spec [ i ] = statspec ;
statspec - > allocated = true ;
}
}
/**
/**