mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-08 07:21:53 +00:00
(svn r25840) -Codechange: Use NUM_AIRPORTS_PER_GRF instead of NUM_AIRPORTS to properly distinguish limits per NewGRF and limits of the pool.
This commit is contained in:
parent
cfaa9457a6
commit
a92b698525
@ -37,7 +37,8 @@ enum AirportTypes {
|
||||
AT_HELISTATION = 8, ///< Heli station airport.
|
||||
AT_OILRIG = 9, ///< Oilrig airport.
|
||||
NEW_AIRPORT_OFFSET = 10, ///< Number of the first newgrf airport.
|
||||
NUM_AIRPORTS = 128, ///< Maximal number of airports.
|
||||
NUM_AIRPORTS_PER_GRF = 128, ///< Maximal number of airports per NewGRF.
|
||||
NUM_AIRPORTS = 128, ///< Maximal number of airports in total.
|
||||
AT_INVALID = 254, ///< Invalid airport.
|
||||
AT_DUMMY = 255, ///< Dummy airport.
|
||||
};
|
||||
|
@ -3554,14 +3554,14 @@ static ChangeInfoResult AirportChangeInfo(uint airport, int numinfo, int prop, B
|
||||
{
|
||||
ChangeInfoResult ret = CIR_SUCCESS;
|
||||
|
||||
if (airport + numinfo > NUM_AIRPORTS) {
|
||||
grfmsg(1, "AirportChangeInfo: Too many airports, trying id (%u), max (%u). Ignoring.", airport + numinfo, NUM_AIRPORTS);
|
||||
if (airport + numinfo > NUM_AIRPORTS_PER_GRF) {
|
||||
grfmsg(1, "AirportChangeInfo: Too many airports, trying id (%u), max (%u). Ignoring.", airport + numinfo, NUM_AIRPORTS_PER_GRF);
|
||||
return CIR_INVALID_ID;
|
||||
}
|
||||
|
||||
/* Allocate industry specs if they haven't been allocated already. */
|
||||
if (_cur.grffile->airportspec == NULL) {
|
||||
_cur.grffile->airportspec = CallocT<AirportSpec*>(NUM_AIRPORTS);
|
||||
_cur.grffile->airportspec = CallocT<AirportSpec*>(NUM_AIRPORTS_PER_GRF);
|
||||
}
|
||||
|
||||
for (int i = 0; i < numinfo; i++) {
|
||||
@ -7805,7 +7805,7 @@ static void ResetCustomAirports()
|
||||
for (GRFFile **file = _grf_files.Begin(); file != end; file++) {
|
||||
AirportSpec **aslist = (*file)->airportspec;
|
||||
if (aslist != NULL) {
|
||||
for (uint i = 0; i < NUM_AIRPORTS; i++) {
|
||||
for (uint i = 0; i < NUM_AIRPORTS_PER_GRF; i++) {
|
||||
AirportSpec *as = aslist[i];
|
||||
|
||||
if (as != NULL) {
|
||||
@ -8572,7 +8572,7 @@ static void FinaliseAirportsArray()
|
||||
for (GRFFile **file = _grf_files.Begin(); file != end; file++) {
|
||||
AirportSpec **&airportspec = (*file)->airportspec;
|
||||
if (airportspec != NULL) {
|
||||
for (int i = 0; i < NUM_AIRPORTS; i++) {
|
||||
for (int i = 0; i < NUM_AIRPORTS_PER_GRF; i++) {
|
||||
if (airportspec[i] != NULL && airportspec[i]->enabled) {
|
||||
_airport_mngr.SetEntitySpec(airportspec[i]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user