changeset 19401:fc9b89f34754 draft

(svn r24302) -Fix: [Script] ScriptTown::GetGrowthRate() returned wrong values after usage of SetGrowthRate().
author frosch <frosch@openttd.org>
date Wed, 30 May 2012 14:54:44 +0000
parents 7e184ff2848d
children 89e786909f09
files src/script/api/script_town.cpp
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/script/api/script_town.cpp
+++ b/src/script/api/script_town.cpp
@@ -152,7 +152,7 @@
 
 	const Town *t = ::Town::Get(town_id);
 
-	return (t->growth_rate * TOWN_GROWTH_TICKS + DAY_TICKS) / DAY_TICKS;
+	return ((t->growth_rate & ~TOWN_GROW_RATE_CUSTOM) * TOWN_GROWTH_TICKS + DAY_TICKS) / DAY_TICKS;
 }
 
 /* static */ int32 ScriptTown::GetDistanceManhattanToTile(TownID town_id, TileIndex tile)