diff options
author | frosch <frosch@openttd.org> | 2013-10-12 16:33:19 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2013-10-12 16:33:19 +0000 |
commit | 6a0439a789fc3a5f8da55493b27d4c9c6c328b1b (patch) | |
tree | 7522f46ab9f0646d701a2803961ed400cfba338c /src/newgrf.cpp | |
parent | ad8b387f9eb8185f25948651b7a34f151812c31d (diff) | |
download | openttd-6a0439a789fc3a5f8da55493b27d4c9c6c328b1b.tar.xz |
(svn r25838) -Codechange: Rename HOUSE_MAX to NUM_HOUSES.
Diffstat (limited to 'src/newgrf.cpp')
-rw-r--r-- | src/newgrf.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp index ae6c0b36f..78c662ad4 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -2183,14 +2183,14 @@ static ChangeInfoResult TownHouseChangeInfo(uint hid, int numinfo, int prop, Byt { ChangeInfoResult ret = CIR_SUCCESS; - if (hid + numinfo > HOUSE_MAX) { - grfmsg(1, "TownHouseChangeInfo: Too many houses loaded (%u), max (%u). Ignoring.", hid + numinfo, HOUSE_MAX); + if (hid + numinfo > NUM_HOUSES) { + grfmsg(1, "TownHouseChangeInfo: Too many houses loaded (%u), max (%u). Ignoring.", hid + numinfo, NUM_HOUSES); return CIR_INVALID_ID; } /* Allocate house specs if they haven't been allocated already. */ if (_cur.grffile->housespec == NULL) { - _cur.grffile->housespec = CallocT<HouseSpec*>(HOUSE_MAX); + _cur.grffile->housespec = CallocT<HouseSpec*>(NUM_HOUSES); } for (int i = 0; i < numinfo; i++) { @@ -7789,7 +7789,7 @@ static void ResetCustomHouses() for (GRFFile **file = _grf_files.Begin(); file != end; file++) { HouseSpec **&housespec = (*file)->housespec; if (housespec == NULL) continue; - for (uint i = 0; i < HOUSE_MAX; i++) { + for (uint i = 0; i < NUM_HOUSES; i++) { free(housespec[i]); } @@ -8380,7 +8380,7 @@ static void EnsureEarlyHouse(HouseZones bitmask) { Year min_year = MAX_YEAR; - for (int i = 0; i < HOUSE_MAX; i++) { + for (int i = 0; i < NUM_HOUSES; i++) { HouseSpec *hs = HouseSpec::Get(i); if (hs == NULL || !hs->enabled) continue; if ((hs->building_availability & bitmask) != bitmask) continue; @@ -8389,7 +8389,7 @@ static void EnsureEarlyHouse(HouseZones bitmask) if (min_year == 0) return; - for (int i = 0; i < HOUSE_MAX; i++) { + for (int i = 0; i < NUM_HOUSES; i++) { HouseSpec *hs = HouseSpec::Get(i); if (hs == NULL || !hs->enabled) continue; if ((hs->building_availability & bitmask) != bitmask) continue; @@ -8419,14 +8419,14 @@ static void FinaliseHouseArray() HouseSpec **&housespec = (*file)->housespec; if (housespec == NULL) continue; - for (int i = 0; i < HOUSE_MAX; i++) { + for (int i = 0; i < NUM_HOUSES; i++) { HouseSpec *hs = housespec[i]; if (hs == NULL) continue; - const HouseSpec *next1 = (i + 1 < HOUSE_MAX ? housespec[i + 1] : NULL); - const HouseSpec *next2 = (i + 2 < HOUSE_MAX ? housespec[i + 2] : NULL); - const HouseSpec *next3 = (i + 3 < HOUSE_MAX ? housespec[i + 3] : NULL); + const HouseSpec *next1 = (i + 1 < NUM_HOUSES ? housespec[i + 1] : NULL); + const HouseSpec *next2 = (i + 2 < NUM_HOUSES ? housespec[i + 2] : NULL); + const HouseSpec *next3 = (i + 3 < NUM_HOUSES ? housespec[i + 3] : NULL); if (!IsHouseSpecValid(hs, next1, next2, next3, (*file)->filename)) continue; @@ -8434,11 +8434,11 @@ static void FinaliseHouseArray() } } - for (int i = 0; i < HOUSE_MAX; i++) { + for (int i = 0; i < NUM_HOUSES; i++) { HouseSpec *hs = HouseSpec::Get(i); - const HouseSpec *next1 = (i + 1 < HOUSE_MAX ? HouseSpec::Get(i + 1) : NULL); - const HouseSpec *next2 = (i + 2 < HOUSE_MAX ? HouseSpec::Get(i + 2) : NULL); - const HouseSpec *next3 = (i + 3 < HOUSE_MAX ? HouseSpec::Get(i + 3) : NULL); + const HouseSpec *next1 = (i + 1 < NUM_HOUSES ? HouseSpec::Get(i + 1) : NULL); + const HouseSpec *next2 = (i + 2 < NUM_HOUSES ? HouseSpec::Get(i + 2) : NULL); + const HouseSpec *next3 = (i + 3 < NUM_HOUSES ? HouseSpec::Get(i + 3) : NULL); /* We need to check all houses again to we are sure that multitile houses * did get consecutive IDs and none of the parts are missing. */ |