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.

(cherry picked from commit f35e257adc)
This commit is contained in:
Patric Stout
2024-01-21 18:36:33 +01:00
committed by Jonathan G Rennison
parent 90859fbe25
commit e1673d5635

View File

@@ -77,8 +77,6 @@ static void CleanupGeneration()
_town_noise_no_update = false; _town_noise_no_update = false;
SetMouseCursorBusy(false); SetMouseCursorBusy(false);
/* Show all vital windows again, because we have hidden them */
if (_game_mode != GM_MENU) ShowVitalWindows();
SetModalProgress(false); SetModalProgress(false);
_gw.proc = nullptr; _gw.proc = nullptr;
_gw.abortp = nullptr; _gw.abortp = nullptr;
@@ -196,6 +194,8 @@ static void _GenerateWorld()
ResetObjectToPlace(); ResetObjectToPlace();
_cur_company.Trash(); _cur_company.Trash();
_current_company = _local_company = _gw.lc; _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); SetGeneratingWorldProgress(GWP_GAME_START, 1);
/* Call any callback */ /* Call any callback */