Skip to content

Commit

Permalink
Fix: Also add the cost of clearing objects on water
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuXarick committed Jan 17, 2020
1 parent a88e497 commit 8f37ea1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/station_cmd.cpp
Expand Up @@ -2554,8 +2554,10 @@ CommandCost CmdBuildDock(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
/* Get the water class of the water tile before it is cleared.*/
WaterClass wc = GetWaterClass(tile_cur);

bool add_cost = !IsWaterTile(tile_cur);
ret = DoCommand(tile_cur, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
if (ret.Failed()) return ret;
if (add_cost) cost.AddCost(ret);

tile_cur += TileOffsByDiagDir(direction);
if (!IsTileType(tile_cur, MP_WATER) || !IsTileFlat(tile_cur)) {
Expand Down

0 comments on commit 8f37ea1

Please sign in to comment.