# HG changeset patch # User glx22 # Date 2019-01-28 16:16:19 # Node ID d7356d836ac78279850b01c4ad77a1624b70fa75 # Parent 5cac1ee0bb0a41c1433843b5de62523b433f518f Fix #7112, fef8b831a9: incorrect precondition check (#7127) diff --git a/src/script/api/script_town.cpp b/src/script/api/script_town.cpp --- 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;