10 #include "../stdafx.h"
11 #include "../newgrf_house.h"
13 #include "../landscape.h"
14 #include "../subsidy_func.h"
15 #include "../strings_func.h"
16 #include "../tilematrix_type.hpp"
21 #include "../safeguards.h"
30 InitializeBuildingCounts();
35 town->cache.population = 0;
36 town->cache.num_houses = 0;
43 Town *town = Town::GetByTile(t);
53 UpdateTownRadius(town);
85 if (t == north_tile) {
86 const HouseSpec *hs = HouseSpec::Get(house_type);
87 bool valid_house =
true;
105 if (!valid_house) DoClearSquare(t);
201 static const SaveLoad _town_supplied_desc[] = {
210 static const SaveLoad _town_received_desc[] = {
219 static void Save_HIDS()
224 static void Load_HIDS()
232 static const SaveLoad _tilematrix_desc[] = {
239 return _tilematrix_desc;
242 static void RealSave_Town(
Town *t)
249 for (
int i = TE_BEGIN; i <
NUM_TE; i++) {
254 static void Save_TOWN()
257 SlSetArrayIndex(t->
index);
262 static void Load_TOWN()
271 for (
CargoID i = 0; i < num_cargo; i++) {
274 for (
int i = TE_BEGIN; i <
TE_END; i++) {
278 if (t->townnamegrfid == 0 && !
IsInsideMM(t->townnametype, SPECSTR_TOWNNAME_START, SPECSTR_TOWNNAME_LAST + 1) &&
GetStringTab(t->townnametype) != TEXT_TAB_OLD_CUSTOM) {
285 SlObject(&dummy, GetTileMatrixDesc());
286 if (dummy.
area.
w != 0) {
287 uint arr_len = dummy.
area.
w / AcceptanceMatrix::GRID * dummy.
area.
h / AcceptanceMatrix::GRID;
307 {
'HIDS', Save_HIDS, Load_HIDS,
nullptr,
nullptr, CH_ARRAY },