From 470c902bdc799cb2e13d4151213f67b7908df99b Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Thu, 9 Jun 2022 21:36:55 +0200 Subject: [PATCH] Fix #9918: Reset industy last production year on scenario start --- src/openttd.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/openttd.cpp b/src/openttd.cpp index 7a1cd0bc4f..638e851e70 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -844,6 +844,11 @@ static void OnStartScenario() { /* Reset engine pool to simplify changing engine NewGRFs in scenario editor. */ EngineOverrideManager::ResetToCurrentNewGRFConfig(); + + /* Make sure all industries were built "this year", to avoid too early closures. (#9918) */ + for (Industry *i : Industry::Iterate()) { + i->last_prod_year = _cur_year; + } } /**