summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2013-10-12 16:35:18 +0000
committerfrosch <frosch@openttd.org>2013-10-12 16:35:18 +0000
commit1b6ceef0862928ad93434fac78679a00b5867367 (patch)
treea26f4e4aad9e4af6bae30b5401d51ca678012eb4 /src
parent48d22700ad0b61aed58be5ac78dc8edd7ed7077f (diff)
downloadopenttd-1b6ceef0862928ad93434fac78679a00b5867367.tar.xz
(svn r25842) -Codechange: Rename MAX_STATIONS to NUM_STATIONS_PER_GRF.
Diffstat (limited to 'src')
-rw-r--r--src/newgrf.cpp10
1 files 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<StationSpec*>(MAX_STATIONS);
+ if (_cur.grffile->stations == NULL) _cur.grffile->stations = CallocT<StationSpec*>(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];