From 41e5c839e08bfc811b1e8d7272996567776b788f Mon Sep 17 00:00:00 2001 From: rubidium Date: Wed, 25 Apr 2012 20:50:13 +0000 Subject: (svn r24179) -Codechange: move some variables of Town to TownCache --- src/script/api/script_town.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/script/api') 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) -- cgit v1.2.3-70-g09d2