summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorglx22 <glx22@users.noreply.github.com>2019-11-14 21:13:15 +0100
committerCharles Pigott <charlespigott@googlemail.com>2019-11-14 20:13:15 +0000
commitddffe32f15807e3ff1baf91b4242951e4ab4e7b5 (patch)
treea876736ff3c8170a2bedd4104f4592d6a7eea623 /src
parent0bdbd509be8fcb7bac921aeffb7b77b55d968155 (diff)
downloadopenttd-ddffe32f15807e3ff1baf91b4242951e4ab4e7b5.tar.xz
Fix #7646: Incomplete cleanup for non-threaded world generation failure (#7805)
Diffstat (limited to 'src')
-rw-r--r--src/genworld.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/genworld.cpp b/src/genworld.cpp
index 656a4f944..c76fe309d 100644
--- a/src/genworld.cpp
+++ b/src/genworld.cpp
@@ -133,11 +133,17 @@ static void _GenerateWorld()
GenerateLandscape(_gw.mode);
GenerateClearTile();
- /* only generate towns, tree and industries in newgame mode. */
+ /* Only generate towns, tree and industries in newgame mode. */
if (_game_mode != GM_EDITOR) {
if (!GenerateTowns(_settings_game.economy.town_layout)) {
_cur_company.Restore();
HandleGeneratingWorldAbortion();
+ BasePersistentStorageArray::SwitchMode(PSM_LEAVE_GAMELOOP);
+ if (_network_dedicated) {
+ /* Exit the game to prevent a return to main menu. */
+ DEBUG(net, 0, "Generating map failed, aborting");
+ _exit_game = true;
+ }
return;
}
GenerateIndustries();