summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzuu <zuu@openttd.org>2013-09-21 15:09:00 +0000
committerzuu <zuu@openttd.org>2013-09-21 15:09:00 +0000
commitffec9b41e8d2efb539d5e24593249bc60baffd13 (patch)
tree20ff96696d68ecadbb0cb6e2d8c170156a3dd85b /src
parentab69c6c2a0ba9ab36db4a20c0e6db2ea404746bf (diff)
downloadopenttd-ffec9b41e8d2efb539d5e24593249bc60baffd13.tar.xz
(svn r25789) -Fix (r25783): Calling GSTown.FoundTown in world gen caused world gen to terminate and start the game
Diffstat (limited to 'src')
-rw-r--r--src/town_cmd.cpp4
1 files 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<bool> 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);