(svn r15689) -Fix [FS#2720]: do not crash when the generate map doesn't contain a suitable location for a town.

This commit is contained in:
rubidium
2009-03-12 15:14:22 +00:00
parent 9dbf8a163f
commit d5a2dc1d0b
3 changed files with 13 additions and 4 deletions

View File

@@ -141,7 +141,10 @@ static void _GenerateWorld(void *arg)
/* only generate towns, tree and industries in newgame mode. */
if (_game_mode != GM_EDITOR) {
GenerateTowns(_settings_game.economy.town_layout);
if (!GenerateTowns(_settings_game.economy.town_layout)) {
HandleGeneratingWorldAbortion();
return;
}
GenerateIndustries();
GenerateUnmovables();
GenerateTrees();
@@ -255,7 +258,10 @@ void HandleGeneratingWorldAbortion()
CleanupGeneration();
_gw.thread->Exit();
if (_gw.thread != NULL) _gw.thread->Exit();
extern void SwitchToMode(SwitchMode new_mode);
SwitchToMode(_switch_mode);
}
/**