# HG changeset patch # User zuu # Date 2013-09-21 15:09:00 # Node ID f138a826b65bdaa2ddd369ac300c8f2859a5beaa # Parent b1ebcc10c74a07b9456c7be5f889542be3cfd44a (svn r25789) -Fix (r25783): Calling GSTown.FoundTown in world gen caused world gen to terminate and start the game diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -1667,7 +1667,7 @@ CommandCost CmdFoundTown(TileIndex tile, return CommandCost(EXPENSES_OTHER); } - _generating_world = true; + Backup old_generating_world(_generating_world, true, FILE_LINE); UpdateNearestTownForRoadTiles(true); Town *t; if (random) { @@ -1682,7 +1682,7 @@ CommandCost CmdFoundTown(TileIndex tile, DoCreateTown(t, tile, townnameparts, size, city, layout, true); } UpdateNearestTownForRoadTiles(false); - _generating_world = false; + old_generating_world.Restore(); if (t != NULL && !StrEmpty(text)) { t->name = strdup(text);