Fix asserts due to main window not existing yet
Partial revert of https://github.com/OpenTTD/OpenTTD/pull/10327
This commit is contained in:
@@ -338,7 +338,9 @@ void GenerateWorld(GenWorldMode mode, uint size_x, uint size_y, bool reset_setti
|
||||
ShowGenerateWorldProgress();
|
||||
|
||||
/* Centre the view on the map */
|
||||
ScrollMainWindowToTile(TileXY(MapSizeX() / 2, MapSizeY() / 2), true);
|
||||
if (FindWindowById(WC_MAIN_WINDOW, 0) != nullptr) {
|
||||
ScrollMainWindowToTile(TileXY(MapSizeX() / 2, MapSizeY() / 2), true);
|
||||
}
|
||||
|
||||
_GenerateWorld();
|
||||
}
|
||||
|
Reference in New Issue
Block a user