From f35e257adc00b48a5a0d6734b4dfa261bac053c3 Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Sun, 21 Jan 2024 18:36:33 +0100 Subject: [PATCH] Fix #9722: create vital windows as soon as local_company is set (#11858) Many places use local_company to detect whether world generation is done, and blindly assume all vital windows exists when local_company is set. --- src/genworld.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/genworld.cpp b/src/genworld.cpp index 31ce5c7425..9c78403777 100644 --- a/src/genworld.cpp +++ b/src/genworld.cpp @@ -72,8 +72,6 @@ static void CleanupGeneration() _generating_world = false; SetMouseCursorBusy(false); - /* Show all vital windows again, because we have hidden them */ - if (_game_mode != GM_MENU) ShowVitalWindows(); SetModalProgress(false); _gw.proc = nullptr; _gw.abortp = nullptr; @@ -182,6 +180,8 @@ static void _GenerateWorld() ResetObjectToPlace(); _cur_company.Trash(); _current_company = _local_company = _gw.lc; + /* Show all vital windows again, because we have hidden them. */ + if (_game_mode != GM_MENU) ShowVitalWindows(); SetGeneratingWorldProgress(GWP_GAME_START, 1); /* Call any callback */