summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorglx22 <glx22@users.noreply.github.com>2019-01-28 17:16:19 +0100
committerIngo von Borstel <github@planetmaker.de>2019-01-28 17:16:19 +0100
commitb28a6784363254de49cc95747c4aada7477d8338 (patch)
treeb8955ca766fa7d3d6f7817f9e4741c5d97ba4bf3 /src
parent654b635f6fb866fcc3ccabcf8333f3b7495ebb26 (diff)
downloadopenttd-b28a6784363254de49cc95747c4aada7477d8338.tar.xz
Fix #7112, fef8b831a9: incorrect precondition check (#7127)
Diffstat (limited to 'src')
-rw-r--r--src/script/api/script_town.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/script/api/script_town.cpp b/src/script/api/script_town.cpp
index 4cdd6a9d0..64f8e166e 100644
--- a/src/script/api/script_town.cpp
+++ b/src/script/api/script_town.cpp
@@ -170,7 +170,7 @@
break;
default:
- EnforcePrecondition(false, days_between_town_growth <= MAX_TOWN_GROWTH_TICKS);
+ EnforcePrecondition(false, (days_between_town_growth * DAY_TICKS / TOWN_GROWTH_TICKS) <= MAX_TOWN_GROWTH_TICKS);
/* Don't use growth_rate 0 as it means GROWTH_NORMAL */
growth_rate = max(days_between_town_growth * DAY_TICKS, 2u) - 1;
break;