diff options
author | frosch <frosch@openttd.org> | 2013-10-12 16:34:59 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2013-10-12 16:34:59 +0000 |
commit | 48d22700ad0b61aed58be5ac78dc8edd7ed7077f (patch) | |
tree | 8bc094be356fa35403e5a435b99e7133e7090af7 /src/newgrf.cpp | |
parent | a92b6985258901b0f45a22a9eb6e61b731e638f1 (diff) | |
download | openttd-48d22700ad0b61aed58be5ac78dc8edd7ed7077f.tar.xz |
(svn r25841) -Codechange: Use NUM_AIRPORTTILES_PER_GRF instead of NUM_AIRPORTTILES to properly distinguish limits per NewGRF and limits of the pool.
-Change: [NewGRF] Lower the limit of airport tile types per NewGRF from 256 to 255 to prevent usage of ID 0xFF in Action3, and thus allowing it to become an extended byte somewhen.
Diffstat (limited to 'src/newgrf.cpp')
-rw-r--r-- | src/newgrf.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp index d4851f88f..f2006e024 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -4118,14 +4118,14 @@ static ChangeInfoResult AirportTilesChangeInfo(uint airtid, int numinfo, int pro { ChangeInfoResult ret = CIR_SUCCESS; - if (airtid + numinfo > NUM_AIRPORTTILES) { - grfmsg(1, "AirportTileChangeInfo: Too many airport tiles loaded (%u), max (%u). Ignoring.", airtid + numinfo, NUM_AIRPORTTILES); + if (airtid + numinfo > NUM_AIRPORTTILES_PER_GRF) { + grfmsg(1, "AirportTileChangeInfo: Too many airport tiles loaded (%u), max (%u). Ignoring.", airtid + numinfo, NUM_AIRPORTTILES_PER_GRF); return CIR_INVALID_ID; } /* Allocate airport tile specs if they haven't been allocated already. */ if (_cur.grffile->airtspec == NULL) { - _cur.grffile->airtspec = CallocT<AirportTileSpec*>(NUM_AIRPORTTILES); + _cur.grffile->airtspec = CallocT<AirportTileSpec*>(NUM_AIRPORTTILES_PER_GRF); } for (int i = 0; i < numinfo; i++) { @@ -7826,7 +7826,7 @@ static void ResetCustomAirports() AirportTileSpec **&airporttilespec = (*file)->airtspec; if (airporttilespec != NULL) { - for (uint i = 0; i < NUM_AIRPORTTILES; i++) { + for (uint i = 0; i < NUM_AIRPORTTILES_PER_GRF; i++) { free(airporttilespec[i]); } free(airporttilespec); @@ -8581,7 +8581,7 @@ static void FinaliseAirportsArray() AirportTileSpec **&airporttilespec = (*file)->airtspec; if (airporttilespec != NULL) { - for (uint i = 0; i < NUM_AIRPORTTILES; i++) { + for (uint i = 0; i < NUM_AIRPORTTILES_PER_GRF; i++) { if (airporttilespec[i] != NULL && airporttilespec[i]->enabled) { _airporttile_mngr.SetEntitySpec(airporttilespec[i]); } |