1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-19 02:12:37 +01:00

(svn r25968) -Add: [Script] ScriptTown::TOWN_GROWTH_NONE to indicate no town growth via ScriptTown::SetGrowthRate and GetGrowthRate.

This commit is contained in:
frosch
2013-11-12 17:57:12 +00:00
parent b1f41a0afb
commit 9a41aefcc4
8 changed files with 22 additions and 9 deletions

View File

@@ -163,6 +163,10 @@
days_between_town_growth = 0;
break;
case TOWN_GROWTH_NONE:
days_between_town_growth = TOWN_GROW_RATE_CUSTOM_NONE;
break;
default:
days_between_town_growth = days_between_town_growth * DAY_TICKS / TOWN_GROWTH_TICKS;
EnforcePrecondition(false, days_between_town_growth < TOWN_GROW_RATE_CUSTOM);
@@ -179,6 +183,8 @@
const Town *t = ::Town::Get(town_id);
if (t->growth_rate == TOWN_GROW_RATE_CUSTOM_NONE) return TOWN_GROWTH_NONE;
return ((t->growth_rate & ~TOWN_GROW_RATE_CUSTOM) * TOWN_GROWTH_TICKS + DAY_TICKS) / DAY_TICKS;
}