diff options
author | frosch <frosch@openttd.org> | 2013-11-12 17:56:35 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2013-11-12 17:56:35 +0000 |
commit | b1f41a0afb460071db2dbbfcb64140488f073382 (patch) | |
tree | 3d7589f178f39c5b013e3977308e6d01eb1278b4 /bin | |
parent | 41184fb871c6debe23f6b2c133373b6a3261cfce (diff) | |
download | openttd-b1f41a0afb460071db2dbbfcb64140488f073382.tar.xz |
(svn r25967) -Add: [NoGo] GSTown::TOWN_GROWTH_NORMAL to reset a town growth rate set previously via GSTown::SetGrowthRate.
Diffstat (limited to 'bin')
-rw-r--r-- | bin/game/compat_1.2.nut | 8 | ||||
-rw-r--r-- | bin/game/compat_1.3.nut | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/bin/game/compat_1.2.nut b/bin/game/compat_1.2.nut index f9a63e698..6126809c8 100644 --- a/bin/game/compat_1.2.nut +++ b/bin/game/compat_1.2.nut @@ -8,3 +8,11 @@ */ GSLog.Info("1.2 API compatability in effect."); + +GSTown._SetGrowthRate <- GSTown.SetGrowthRate; +GSTown.SetGrowthRate <- function(town_id, days_between_town_growth) +{ + /* Growth rate 0 caused resetting the custom growth rate. While this was undocumented, it was used nevertheless (ofc). */ + if (days_between_town_growth == 0) days_between_town_growth = GSTown.TOWN_GROWTH_NORMAL; + return GSTown._SetGrowthRate(town_id, days_between_town_growth); +} diff --git a/bin/game/compat_1.3.nut b/bin/game/compat_1.3.nut index 656794c89..d58a34685 100644 --- a/bin/game/compat_1.3.nut +++ b/bin/game/compat_1.3.nut @@ -8,3 +8,11 @@ */ GSLog.Info("1.3 API compatability in effect."); + +GSTown._SetGrowthRate <- GSTown.SetGrowthRate; +GSTown.SetGrowthRate <- function(town_id, days_between_town_growth) +{ + /* Growth rate 0 caused resetting the custom growth rate. While this was undocumented, it was used nevertheless (ofc). */ + if (days_between_town_growth == 0) days_between_town_growth = GSTown.TOWN_GROWTH_NORMAL; + return GSTown._SetGrowthRate(town_id, days_between_town_growth); +} |