OpenTTD

town_sl.cpp
Go to the documentation of this file.
1 /* $Id: town_sl.cpp 27756 2017-02-26 19:40:53Z frosch $ */
2
3 /*
4 * This file is part of OpenTTD.
5 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
6 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8 */
9
12 #include "../stdafx.h"
13 #include "../newgrf_house.h"
14 #include "../town.h"
15 #include "../landscape.h"
16 #include "../subsidy_func.h"
17 #include "../strings_func.h"
18
19 #include "saveload.h"
20 #include "newgrf_sl.h"
21
22 #include "../safeguards.h"
23
27 void RebuildTownCaches()
28 {
29 Town *town;
30 InitializeBuildingCounts();
31
32 /* Reset town population and num_houses */
33 FOR_ALL_TOWNS(town) {
34 town->cache.population = 0;
35 town->cache.num_houses = 0;
36 }
37
38 for (TileIndex t = 0; t < MapSize(); t++) {
39 if (!IsTileType(t, MP_HOUSE)) continue;
40
41 HouseID house_id = GetHouseType(t);
42 town = Town::GetByTile(t);
43 IncreaseBuildingCount(town, house_id);
44 if (IsHouseCompleted(t)) town->cache.population += HouseSpec::Get(house_id)->population;
45
46 /* Increase the number of houses for every house, but only once. */
47 if (GetHouseNorthPart(house_id) == 0) town->cache.num_houses++;
48 }
49
50 /* Update the population and num_house dependent values */
51 FOR_ALL_TOWNS(town) {
52 UpdateTownRadius(town);
53 UpdateTownCargoes(town);
54 }
55 UpdateTownCargoBitmap();
56 }
57
66 void UpdateHousesAndTowns()
67 {
68 for (TileIndex t = 0; t < MapSize(); t++) {
69 if (!IsTileType(t, MP_HOUSE)) continue;
70
71 HouseID house_id = GetCleanHouseType(t);
72 if (!HouseSpec::Get(house_id)->enabled && house_id >= NEW_HOUSE_OFFSET) {
73 /* The specs for this type of house are not available any more, so
74 * replace it with the substitute original house type. */
75 house_id = _house_mngr.GetSubstituteID(house_id);
76 SetHouseType(t, house_id);
77 }
78 }
79
80 /* Check for cases when a NewGRF has set a wrong house substitute type. */
81 for (TileIndex t = 0; t < MapSize(); t++) {
82 if (!IsTileType(t, MP_HOUSE)) continue;
83
84 HouseID house_type = GetCleanHouseType(t);
85 TileIndex north_tile = t + GetHouseNorthPart(house_type); // modifies 'house_type'!
86 if (t == north_tile) {
87 const HouseSpec *hs = HouseSpec::Get(house_type);
88 bool valid_house = true;
89 if (hs->building_flags & TILE_SIZE_2x1) {
90 TileIndex tile = t + TileDiffXY(1, 0);
91 if (!IsTileType(tile, MP_HOUSE) || GetCleanHouseType(tile) != house_type + 1) valid_house = false;
92 } else if (hs->building_flags & TILE_SIZE_1x2) {
93 TileIndex tile = t + TileDiffXY(0, 1);
94 if (!IsTileType(tile, MP_HOUSE) || GetCleanHouseType(tile) != house_type + 1) valid_house = false;
95 } else if (hs->building_flags & TILE_SIZE_2x2) {
96 TileIndex tile = t + TileDiffXY(0, 1);
97 if (!IsTileType(tile, MP_HOUSE) || GetCleanHouseType(tile) != house_type + 1) valid_house = false;
98 tile = t + TileDiffXY(1, 0);
99 if (!IsTileType(tile, MP_HOUSE) || GetCleanHouseType(tile) != house_type + 2) valid_house = false;
100 tile = t + TileDiffXY(1, 1);
101 if (!IsTileType(tile, MP_HOUSE) || GetCleanHouseType(tile) != house_type + 3) valid_house = false;
102 }
103 /* If not all tiles of this house are present remove the house.
104 * The other tiles will get removed later in this loop because
105 * their north tile is not the correct type anymore. */
106 if (!valid_house) DoClearSquare(t);
107 } else if (!IsTileType(north_tile, MP_HOUSE) || GetCleanHouseType(north_tile) != house_type) {
108 /* This tile should be part of a multi-tile building but the
109 * north tile of this house isn't on the map. */
110 DoClearSquare(t);
111 }
112 }
113
114 RebuildTownCaches();
115 }
116
118 static const SaveLoad _town_desc[] = {
119 SLE_CONDVAR(Town, xy, SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
120 SLE_CONDVAR(Town, xy, SLE_UINT32, 6, SL_MAX_VERSION),
121
122 SLE_CONDNULL(2, 0, 2),
123 SLE_CONDNULL(4, 3, 84),
124 SLE_CONDNULL(2, 0, 91),
125
126 SLE_CONDVAR(Town, townnamegrfid, SLE_UINT32, 66, SL_MAX_VERSION),
127 SLE_VAR(Town, townnametype, SLE_UINT16),
128 SLE_VAR(Town, townnameparts, SLE_UINT32),
129 SLE_CONDSTR(Town, name, SLE_STR | SLF_ALLOW_CONTROL, 0, 84, SL_MAX_VERSION),
130
131 SLE_VAR(Town, flags, SLE_UINT8),
132 SLE_CONDVAR(Town, statues, SLE_FILE_U8 | SLE_VAR_U16, 0, 103),
133 SLE_CONDVAR(Town, statues, SLE_UINT16, 104, SL_MAX_VERSION),
134
135 SLE_CONDNULL(1, 0, 1),
136
137 SLE_CONDVAR(Town, have_ratings, SLE_FILE_U8 | SLE_VAR_U16, 0, 103),
138 SLE_CONDVAR(Town, have_ratings, SLE_UINT16, 104, SL_MAX_VERSION),
139 SLE_CONDARR(Town, ratings, SLE_INT16, 8, 0, 103),
140 SLE_CONDARR(Town, ratings, SLE_INT16, MAX_COMPANIES, 104, SL_MAX_VERSION),
141 /* failed bribe attempts are stored since savegame format 4 */
142 SLE_CONDARR(Town, unwanted, SLE_INT8, 8, 4, 103),
143 SLE_CONDARR(Town, unwanted, SLE_INT8, MAX_COMPANIES, 104, SL_MAX_VERSION),
144
145 SLE_CONDVAR(Town, supplied[CT_PASSENGERS].old_max, SLE_FILE_U16 | SLE_VAR_U32, 0, 8),
146 SLE_CONDVAR(Town, supplied[CT_MAIL].old_max, SLE_FILE_U16 | SLE_VAR_U32, 0, 8),
147 SLE_CONDVAR(Town, supplied[CT_PASSENGERS].new_max, SLE_FILE_U16 | SLE_VAR_U32, 0, 8),
148 SLE_CONDVAR(Town, supplied[CT_MAIL].new_max, SLE_FILE_U16 | SLE_VAR_U32, 0, 8),
149 SLE_CONDVAR(Town, supplied[CT_PASSENGERS].old_act, SLE_FILE_U16 | SLE_VAR_U32, 0, 8),
150 SLE_CONDVAR(Town, supplied[CT_MAIL].old_act, SLE_FILE_U16 | SLE_VAR_U32, 0, 8),
151 SLE_CONDVAR(Town, supplied[CT_PASSENGERS].new_act, SLE_FILE_U16 | SLE_VAR_U32, 0, 8),
152 SLE_CONDVAR(Town, supplied[CT_MAIL].new_act, SLE_FILE_U16 | SLE_VAR_U32, 0, 8),
153
154 SLE_CONDVAR(Town, supplied[CT_PASSENGERS].old_max, SLE_UINT32, 9, 164),
155 SLE_CONDVAR(Town, supplied[CT_MAIL].old_max, SLE_UINT32, 9, 164),
156 SLE_CONDVAR(Town, supplied[CT_PASSENGERS].new_max, SLE_UINT32, 9, 164),
157 SLE_CONDVAR(Town, supplied[CT_MAIL].new_max, SLE_UINT32, 9, 164),
158 SLE_CONDVAR(Town, supplied[CT_PASSENGERS].old_act, SLE_UINT32, 9, 164),
159 SLE_CONDVAR(Town, supplied[CT_MAIL].old_act, SLE_UINT32, 9, 164),
160 SLE_CONDVAR(Town, supplied[CT_PASSENGERS].new_act, SLE_UINT32, 9, 164),
161 SLE_CONDVAR(Town, supplied[CT_MAIL].new_act, SLE_UINT32, 9, 164),
162
163 SLE_CONDNULL(2, 0, 163),
164
165 SLE_CONDVAR(Town, received[TE_FOOD].old_act, SLE_UINT16, 0, 164),
166 SLE_CONDVAR(Town, received[TE_WATER].old_act, SLE_UINT16, 0, 164),
167 SLE_CONDVAR(Town, received[TE_FOOD].new_act, SLE_UINT16, 0, 164),
168 SLE_CONDVAR(Town, received[TE_WATER].new_act, SLE_UINT16, 0, 164),
169
170 SLE_CONDARR(Town, goal, SLE_UINT32, NUM_TE, 165, SL_MAX_VERSION),
171
172 SLE_CONDSTR(Town, text, SLE_STR | SLF_ALLOW_CONTROL, 0, 168, SL_MAX_VERSION),
173
174 SLE_CONDVAR(Town, time_until_rebuild, SLE_FILE_U8 | SLE_VAR_U16, 0, 53),
175 SLE_CONDVAR(Town, grow_counter, SLE_FILE_U8 | SLE_VAR_U16, 0, 53),
176 SLE_CONDVAR(Town, growth_rate, SLE_FILE_U8 | SLE_VAR_I16, 0, 53),
177
178 SLE_CONDVAR(Town, time_until_rebuild, SLE_UINT16, 54, SL_MAX_VERSION),
179 SLE_CONDVAR(Town, grow_counter, SLE_UINT16, 54, SL_MAX_VERSION),
180
181 SLE_CONDVAR(Town, growth_rate, SLE_FILE_I16 | SLE_VAR_U16, 54, 164),
182 SLE_CONDVAR(Town, growth_rate, SLE_UINT16, 165, SL_MAX_VERSION),
183
184 SLE_VAR(Town, fund_buildings_months, SLE_UINT8),
185 SLE_VAR(Town, road_build_months, SLE_UINT8),
186
187 SLE_CONDVAR(Town, exclusivity, SLE_UINT8, 2, SL_MAX_VERSION),
188 SLE_CONDVAR(Town, exclusive_counter, SLE_UINT8, 2, SL_MAX_VERSION),
189
190 SLE_CONDVAR(Town, larger_town, SLE_BOOL, 56, SL_MAX_VERSION),
191 SLE_CONDVAR(Town, layout, SLE_UINT8, 113, SL_MAX_VERSION),
192
193 SLE_CONDLST(Town, psa_list, REF_STORAGE, 161, SL_MAX_VERSION),
194
195 SLE_CONDVAR(Town, cargo_produced, SLE_UINT32, 166, SL_MAX_VERSION),
196
197 /* reserve extra space in savegame here. (currently 30 bytes) */
198 SLE_CONDNULL(30, 2, SL_MAX_VERSION),
199
200 SLE_END()
201 };
202
203 static const SaveLoad _town_supplied_desc[] = {
204 SLE_CONDVAR(TransportedCargoStat<uint32>, old_max, SLE_UINT32, 165, SL_MAX_VERSION),
205 SLE_CONDVAR(TransportedCargoStat<uint32>, new_max, SLE_UINT32, 165, SL_MAX_VERSION),
206 SLE_CONDVAR(TransportedCargoStat<uint32>, old_act, SLE_UINT32, 165, SL_MAX_VERSION),
207 SLE_CONDVAR(TransportedCargoStat<uint32>, new_act, SLE_UINT32, 165, SL_MAX_VERSION),
208
209 SLE_END()
210 };
211
212 static const SaveLoad _town_received_desc[] = {
213 SLE_CONDVAR(TransportedCargoStat<uint16>, old_max, SLE_UINT16, 165, SL_MAX_VERSION),
214 SLE_CONDVAR(TransportedCargoStat<uint16>, new_max, SLE_UINT16, 165, SL_MAX_VERSION),
215 SLE_CONDVAR(TransportedCargoStat<uint16>, old_act, SLE_UINT16, 165, SL_MAX_VERSION),
216 SLE_CONDVAR(TransportedCargoStat<uint16>, new_act, SLE_UINT16, 165, SL_MAX_VERSION),
217
218 SLE_END()
219 };
220
221 static void Save_HIDS()
222 {
223 Save_NewGRFMapping(_house_mngr);
224 }
225
226 static void Load_HIDS()
227 {
228 Load_NewGRFMapping(_house_mngr);
229 }
230
231 const SaveLoad *GetTileMatrixDesc()
232 {
233 /* Here due to private member vars. */
234 static const SaveLoad _tilematrix_desc[] = {
235 SLE_VAR(AcceptanceMatrix, area.tile, SLE_UINT32),
236 SLE_VAR(AcceptanceMatrix, area.w, SLE_UINT16),
237 SLE_VAR(AcceptanceMatrix, area.h, SLE_UINT16),
238 SLE_END()
239 };
240
241 return _tilematrix_desc;
242 }
243
244 static void RealSave_Town(Town *t)
245 {
246 SlObject(t, _town_desc);
247
248 for (CargoID i = 0; i < NUM_CARGO; i++) {
249 SlObject(&t->supplied[i], _town_supplied_desc);
250 }
251 for (int i = TE_BEGIN; i < NUM_TE; i++) {
252 SlObject(&t->received[i], _town_received_desc);
253 }
254
255 if (IsSavegameVersionBefore(166)) return;
256
257 SlObject(&t->cargo_accepted, GetTileMatrixDesc());
258 if (t->cargo_accepted.area.w != 0) {
259 uint arr_len = t->cargo_accepted.area.w / AcceptanceMatrix::GRID * t->cargo_accepted.area.h / AcceptanceMatrix::GRID;
260 SlArray(t->cargo_accepted.data, arr_len, SLE_UINT32);
261 }
262 }
263
264 static void Save_TOWN()
265 {
266 Town *t;
267
268 FOR_ALL_TOWNS(t) {
269 SlSetArrayIndex(t->index);
270 SlAutolength((AutolengthProc*)RealSave_Town, t);
271 }
272 }
273
274 static void Load_TOWN()
275 {
276 int index;
277
278 while ((index = SlIterateArray()) != -1) {
279 Town *t = new (index) Town();
280 SlObject(t, _town_desc);
281
282 for (CargoID i = 0; i < NUM_CARGO; i++) {
283 SlObject(&t->supplied[i], _town_supplied_desc);
284 }
285 for (int i = TE_BEGIN; i < TE_END; i++) {
286 SlObject(&t->received[i], _town_received_desc);
287 }
288
289 if (t->townnamegrfid == 0 && !IsInsideMM(t->townnametype, SPECSTR_TOWNNAME_START, SPECSTR_TOWNNAME_LAST + 1) && GetStringTab(t->townnametype) != TEXT_TAB_OLD_CUSTOM) {
290 SlErrorCorrupt("Invalid town name generator");
291 }
292
293 if (IsSavegameVersionBefore(166)) continue;
294
295 SlObject(&t->cargo_accepted, GetTileMatrixDesc());
296 if (t->cargo_accepted.area.w != 0) {
297 uint arr_len = t->cargo_accepted.area.w / AcceptanceMatrix::GRID * t->cargo_accepted.area.h / AcceptanceMatrix::GRID;
298 t->cargo_accepted.data = MallocT<uint32>(arr_len);
299 SlArray(t->cargo_accepted.data, arr_len, SLE_UINT32);
300
301 /* Rebuild total cargo acceptance. */
302 UpdateTownCargoTotal(t);
303 }
304 }
305 }
306
308 static void Ptrs_TOWN()
309 {
310 /* Don't run when savegame version lower than 161. */
311 if (IsSavegameVersionBefore(161)) return;
312
313 Town *t;
314 FOR_ALL_TOWNS(t) {
315 SlObject(t, _town_desc);
316 }
317 }
318
320 extern const ChunkHandler _town_chunk_handlers[] = {
321 { 'HIDS', Save_HIDS, Load_HIDS, NULL, NULL, CH_ARRAY },
322 { 'CITY', Save_TOWN, Load_TOWN, Ptrs_TOWN, NULL, CH_ARRAY | CH_LAST},
323 };
SLE_CONDNULL
#define SLE_CONDNULL(length, from, to)
Empty space in some savegame versions.
Definition: saveload.h:344
GetHouseNorthPart
TileIndexDiff GetHouseNorthPart(HouseID &house)
Determines if a given HouseID is part of a multitile house.
Definition: town_cmd.cpp:2415
Town::cargo_accepted
AcceptanceMatrix cargo_accepted
Bitmap of cargoes accepted by houses for each 4*4 map square of the town.
Definition: town.h:89
Ptrs_TOWN
static void Ptrs_TOWN()
Fix pointers when loading town data.
Definition: town_sl.cpp:308
Town::received
TransportedCargoStat< uint16 > received[NUM_TE]
Cargo statistics about received cargotypes.
Definition: town.h:80
UpdateTownCargoes
void UpdateTownCargoes(Town *t)
Update cargo acceptance for the complete town.
Definition: town_cmd.cpp:749
newgrf_sl.h
Code handling saving and loading of NewGRF mappings.
UpdateTownCargoTotal
void UpdateTownCargoTotal(Town *t)
Update the total cargo acceptance of the whole town.
Definition: town_cmd.cpp:701
SLE_CONDSTR
#define SLE_CONDSTR(base, variable, type, length, from, to)
Storage of a string in some savegame versions.
Definition: saveload.h:278
SlErrorCorrupt
void NORETURN SlErrorCorrupt(const char *msg)
Error handler for corrupt savegames.
Definition: saveload.cpp:561
IsInsideMM
static bool IsInsideMM(const T x, const uint min, const uint max)
Checks if a value is in an interval.
Definition: math_func.hpp:266
RebuildTownCaches
void RebuildTownCaches()
Rebuild all the cached variables of towns.
Definition: town_sl.cpp:27
_town_desc
static const SaveLoad _town_desc[]
Save and load of towns.
Definition: town_sl.cpp:118
UpdateHousesAndTowns
void UpdateHousesAndTowns()
Check and update town and house values.
Definition: town_sl.cpp:66
NUM_TE
Amount of town effects.
Definition: cargotype.h:34
Pool::PoolItem::index
Tindex index
Index of this pool item.
Definition: pool_type.hpp:147
_town_chunk_handlers
const ChunkHandler _town_chunk_handlers[]
Chunk handler for towns.
TE_WATER
Cargo behaves water-like.
Definition: cargotype.h:31
GetStringTab
static StringTab GetStringTab(StringID str)
Extract the StringTab from a StringID.
Definition: strings_func.h:25
HouseID
uint16 HouseID
OpenTTD ID of house types.
Definition: house_type.h:15
TownCache::population
uint32 population
Current population of people.
Definition: town.h:47
OrthogonalTileArea::w
uint16 w
The width of the area.
Definition: tilearea_type.h:20
SLE_CONDLST
#define SLE_CONDLST(base, variable, type, from, to)
Storage of a list in some savegame versions.
Definition: saveload.h:288
UpdateTownCargoBitmap
void UpdateTownCargoBitmap()
Updates the bitmap of all cargoes accepted by houses.
Definition: town_cmd.cpp:768
SetHouseType
static void SetHouseType(TileIndex t, HouseID house_id)
Set the house type.
Definition: town_map.h:72
HouseSpec::population
byte population
population (Zero on other tiles in multi tile house.)
Definition: house.h:102
SlArray
void SlArray(void *array, size_t length, VarType conv)
Save/Load an array.
Definition: saveload.cpp:1186
IsHouseCompleted
static bool IsHouseCompleted(TileIndex t)
Get the completion of this house.
Definition: town_map.h:147
TileMatrix::data
T * data
Pointer to data array.
Definition: tilematrix_type.hpp:70
saveload.h
Functions/types related to saving and loading games.
SLE_CONDVAR
#define SLE_CONDVAR(base, variable, type, from, to)
Storage of a variable in some savegame versions.
Definition: saveload.h:246
IsTileType
static bool IsTileType(TileIndex tile, TileType type)
Checks if a tile is a give tiletype.
Definition: tile_map.h:143
GetCleanHouseType
static HouseID GetCleanHouseType(TileIndex t)
Get the type of this house, which is an index into the house spec array without doing any NewGRF rela...
Definition: town_map.h:49
SLF_ALLOW_CONTROL
allow control codes in the strings
Definition: saveload.h:184
SL_MAX_VERSION
#define SL_MAX_VERSION
Highest possible savegame version.
Definition: saveload.h:96
IsSavegameVersionBefore
static bool IsSavegameVersionBefore(uint16 major, byte minor=0)
Checks whether the savegame is below major.
Definition: saveload.h:465
HouseSpec::building_flags
BuildingFlags building_flags
some flags that describe the house (size, stadium etc...)
Definition: house.h:109
SlIterateArray
int SlIterateArray()
Iterate through the elements of an array and read the whole thing.
Definition: saveload.cpp:828
MAX_COMPANIES
Maximum number of companies.
Definition: company_type.h:25
ChunkHandler
Handlers and description of chunk.
Definition: saveload.h:66
TileMatrix::area
TileArea area
Area covered by the matrix.
Definition: tilematrix_type.hpp:68
NUM_CARGO
Maximal number of cargo types in a game.
Definition: cargo_type.h:66
Load_NewGRFMapping
void Load_NewGRFMapping(OverrideManagerBase &mapping)
Load a GRF ID + local id -> OpenTTD&#39;s id mapping.
Definition: newgrf_sl.cpp:44
SLE_END
#define SLE_END()
End marker of a struct/class save or load.
Definition: saveload.h:353
TileMatrix< uint32, 4 >
HouseSpec
Definition: house.h:98
MapSize
static uint MapSize()
Get the size of the map.
Definition: map_func.h:94
SLE_CONDARR
#define SLE_CONDARR(base, variable, type, length, from, to)
Storage of an array in some savegame versions.
Definition: saveload.h:267
TileIndex
uint32 TileIndex
The index/ID of a Tile.
Definition: tile_type.h:80
GetHouseType
static HouseID GetHouseType(TileIndex t)
Get the type of this house, which is an index into the house spec array.
Definition: town_map.h:61
SlObject
void SlObject(void *object, const SaveLoad *sld)
Main SaveLoad function.
Definition: saveload.cpp:1612
Town::cache
TownCache cache
Container for all cacheable data.
Definition: town.h:58
NEW_HOUSE_OFFSET
static const HouseID NEW_HOUSE_OFFSET
Offset for new houses.
Definition: house.h:30
Town
Town data structure.
Definition: town.h:55
TE_END
End of town effects.
Definition: cargotype.h:33
TransportedCargoStat< uint32 >
SlAutolength
void SlAutolength(AutolengthProc *proc, void *arg)
Do something of which I have no idea what it is :P.
Definition: saveload.cpp:1640
TE_FOOD
Cargo behaves food/fizzy-drinks-like.
Definition: cargotype.h:32
TileDiffXY
static TileIndexDiff TileDiffXY(int x, int y)
Calculates an offset for the given coordinate(-offset).
Definition: map_func.h:181
SaveLoad
SaveLoad type struct.
Definition: saveload.h:208
SLE_VAR
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition: saveload.h:296
SLE_STR
#define SLE_STR(base, variable, type, length)
Storage of a string in every savegame version.
Definition: saveload.h:322
Town::supplied
TransportedCargoStat< uint32 > supplied[NUM_CARGO]
Cargo statistics about supplied cargo.
Definition: town.h:79
MP_HOUSE
A house by a town.
Definition: tile_type.h:46
CargoID
byte CargoID
Cargo slots to indicate a cargo type within a game.
Definition: cargo_type.h:22
IncreaseBuildingCount
void IncreaseBuildingCount(Town *t, HouseID house_id)
IncreaseBuildingCount() Increase the count of a building when it has been added by a town...
Definition: newgrf_house.cpp:100
TownCache::num_houses
uint32 num_houses
Amount of houses.
Definition: town.h:46
Save_NewGRFMapping
void Save_NewGRFMapping(const OverrideManagerBase &mapping)
Save a GRF ID + local id -> OpenTTD&#39;s id mapping.
Definition: newgrf_sl.cpp:32
OrthogonalTileArea::h
uint16 h
The height of the area.
Definition: tilearea_type.h:21
CH_LAST
Last chunk in this array.
Definition: saveload.h:104
OverrideManagerBase::GetSubstituteID
uint16 GetSubstituteID(uint16 entity_id) const
Gives the substitute of the entity, as specified by the grf file.
Definition: newgrf_commons.cpp:168
REF_STORAGE
Load/save a reference to a persistent storage.
Definition: saveload.h:90