From b28a6784363254de49cc95747c4aada7477d8338 Mon Sep 17 00:00:00 2001 From: glx22 Date: Mon, 28 Jan 2019 17:16:19 +0100 Subject: Fix #7112, fef8b831a9: incorrect precondition check (#7127) --- src/script/api/script_town.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/script') 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; -- cgit v1.2.3-70-g09d2