diff options
author | rubidium <rubidium@openttd.org> | 2012-04-25 20:50:13 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2012-04-25 20:50:13 +0000 |
commit | 41e5c839e08bfc811b1e8d7272996567776b788f (patch) | |
tree | eb8a74437dd42a7a57e157c6218e96b9df7fbd87 /src/script | |
parent | cd50c862944098753c959cc272d62a2ddc212ca8 (diff) | |
download | openttd-41e5c839e08bfc811b1e8d7272996567776b788f.tar.xz |
(svn r24179) -Codechange: move some variables of Town to TownCache
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/api/script_town.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/script/api/script_town.cpp b/src/script/api/script_town.cpp index 331b98891..0e16e905f 100644 --- a/src/script/api/script_town.cpp +++ b/src/script/api/script_town.cpp @@ -52,14 +52,14 @@ { if (!IsValidTown(town_id)) return -1; const Town *t = ::Town::Get(town_id); - return t->population; + return t->cache.population; } /* static */ int32 ScriptTown::GetHouseCount(TownID town_id) { if (!IsValidTown(town_id)) return -1; const Town *t = ::Town::Get(town_id); - return t->num_houses; + return t->cache.num_houses; } /* static */ TileIndex ScriptTown::GetLocation(TownID town_id) @@ -125,11 +125,11 @@ switch (t->goal[towneffect_id]) { case TOWN_GROWTH_WINTER: - if (TileHeight(t->xy) >= GetSnowLine() && t->population > 90) return 1; + if (TileHeight(t->xy) >= GetSnowLine() && t->cache.population > 90) return 1; return 0; case TOWN_GROWTH_DESERT: - if (GetTropicZone(t->xy) == TROPICZONE_DESERT && t->population > 60) return 1; + if (GetTropicZone(t->xy) == TROPICZONE_DESERT && t->cache.population > 60) return 1; return 0; default: return t->goal[towneffect_id]; @@ -170,7 +170,7 @@ if (!IsValidTown(town_id)) return false; const Town *t = ::Town::Get(town_id); - return ((uint32)GetDistanceSquareToTile(town_id, tile) <= t->squared_town_zone_radius[0]); + return ((uint32)GetDistanceSquareToTile(town_id, tile) <= t->cache.squared_town_zone_radius[0]); } /* static */ bool ScriptTown::HasStatue(TownID town_id) |