From 1b6ceef0862928ad93434fac78679a00b5867367 Mon Sep 17 00:00:00 2001 From: frosch Date: Sat, 12 Oct 2013 16:35:18 +0000 Subject: (svn r25842) -Codechange: Rename MAX_STATIONS to NUM_STATIONS_PER_GRF. --- src/newgrf.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/newgrf.cpp b/src/newgrf.cpp index f2006e024..8f4fb0436 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -280,7 +280,7 @@ public: typedef void (*SpecialSpriteHandler)(ByteReader *buf); -static const uint MAX_STATIONS = 256; +static const uint NUM_STATIONS_PER_GRF = 255; ///< Number of StationSpecs per NewGRF; limited to 255 to allow extending Action3 with an extended byte later on. /** Temporary engine data used when loading only */ struct GRFTempEngineData { @@ -1726,13 +1726,13 @@ static ChangeInfoResult StationChangeInfo(uint stid, int numinfo, int prop, Byte { ChangeInfoResult ret = CIR_SUCCESS; - if (stid + numinfo > MAX_STATIONS) { - grfmsg(1, "StationChangeInfo: Station %u is invalid, max %u, ignoring", stid + numinfo, MAX_STATIONS); + if (stid + numinfo > NUM_STATIONS_PER_GRF) { + grfmsg(1, "StationChangeInfo: Station %u is invalid, max %u, ignoring", stid + numinfo, NUM_STATIONS_PER_GRF); return CIR_INVALID_ID; } /* Allocate station specs if necessary */ - if (_cur.grffile->stations == NULL) _cur.grffile->stations = CallocT(MAX_STATIONS); + if (_cur.grffile->stations == NULL) _cur.grffile->stations = CallocT(NUM_STATIONS_PER_GRF); for (int i = 0; i < numinfo; i++) { StationSpec *statspec = _cur.grffile->stations[stid + i]; @@ -7754,7 +7754,7 @@ static void ResetCustomStations() for (GRFFile **file = _grf_files.Begin(); file != end; file++) { StationSpec **&stations = (*file)->stations; if (stations == NULL) continue; - for (uint i = 0; i < MAX_STATIONS; i++) { + for (uint i = 0; i < NUM_STATIONS_PER_GRF; i++) { if (stations[i] == NULL) continue; StationSpec *statspec = stations[i]; -- cgit v1.2.3-54-g00ecf