From ffec9b41e8d2efb539d5e24593249bc60baffd13 Mon Sep 17 00:00:00 2001 From: zuu Date: Sat, 21 Sep 2013 15:09:00 +0000 Subject: (svn r25789) -Fix (r25783): Calling GSTown.FoundTown in world gen caused world gen to terminate and start the game --- src/town_cmd.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 7241f7ed4..e16ff4836 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -1667,7 +1667,7 @@ CommandCost CmdFoundTown(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 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, DoCommandFlag flags, uint32 p1, uint32 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); -- cgit v1.2.3-70-g09d2