Fix DC_FORCE_CLEAR_TILE water removal not removing docking tiles

See: https://github.com/OpenTTD/OpenTTD/issues/9869
pull/383/head
Jonathan G Rennison 2 years ago
parent e3837e790d
commit ef379b5214

@ -755,7 +755,7 @@ CommandCost CmdLandscapeClear(TileIndex tile, DoCommandFlag flags, uint32 p1, ui
if (flags & DC_EXEC) {
if (c != nullptr) c->clear_limit -= 1 << 16;
if (do_clear) DoClearSquare(tile);
if (do_clear) ForceClearWaterTile(tile);
}
return cost;
}

@ -44,6 +44,8 @@ static const uint RIVER_OFFSET_DESERT_DISTANCE = 5; ///< Circular tile search ra
bool IsWateredTile(TileIndex tile, Direction from);
void ForceClearWaterTile(TileIndex tile);
/**
* Calculates the maintenance cost of a number of canal tiles.
* @param num Number of canal tiles.

@ -634,6 +634,15 @@ static CommandCost ClearTile_Water(TileIndex tile, DoCommandFlag flags)
}
}
void ForceClearWaterTile(TileIndex tile)
{
bool remove = IsDockingTile(tile);
DoClearSquare(tile);
MarkCanalsAndRiversAroundDirty(tile);
if (remove) RemoveDockingTile(tile);
ClearNeighbourNonFloodingStates(tile);
}
/**
* return true if a tile is a water tile wrt. a certain direction.
*

Loading…
Cancel
Save