Skip to content

Commit

Permalink
Debug: mark tiles where a flood exist
Browse files Browse the repository at this point in the history
This commit is used for debugging OpenTTD#8492.  Intended to use when starting a new game. Affected tiles will have a sign placed on them, so you can quickly get to them after world generation.

During world generation, town growth algorithm is speed up, allowing the town to perform multiple sequential growth actions, like building houses, roads, and terraforming. If it happens to lower terrain adjacent to sea and then in one of those sequences it builds a road or a house there, it will end up flooded during the "run tile loop" phase of world generation.
  • Loading branch information
SamuXarick committed Jun 12, 2022
1 parent 814c61a commit 3939097
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/water_cmd.cpp
Expand Up @@ -39,6 +39,7 @@
#include "industry.h"
#include "water_cmd.h"
#include "landscape_cmd.h"
#include "signs_cmd.h"

#include "table/strings.h"

Expand Down Expand Up @@ -1145,7 +1146,10 @@ void DoFloodTile(TileIndex target)
FloodVehicles(target);

/* flood flat tile */
TileType type = GetTileType(target);
char *text = type == MP_HOUSE ? "h" : "r";
if (Command<CMD_LANDSCAPE_CLEAR>::Do(DC_EXEC, target).Succeeded()) {
Command<CMD_PLACE_SIGN>::Do(DC_EXEC, target, text);
MakeSea(target);
MarkTileDirtyByTile(target);
flooded = true;
Expand Down

0 comments on commit 3939097

Please sign in to comment.