mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-09-01 10:59:12 +00:00
(svn r25789) -Fix (r25783): Calling GSTown.FoundTown in world gen caused world gen to terminate and start the game
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user