summaryrefslogtreecommitdiff
path: root/src/station_cmd.cpp
diff options
context:
space:
mode:
authorSamuXarick <43006711+SamuXarick@users.noreply.github.com>2021-01-07 09:35:09 +0000
committerGitHub <noreply@github.com>2021-01-07 10:35:09 +0100
commitf84a466ca516136de218bc599bbfaf8c909829f4 (patch)
tree763668f5f83067845e1c2b03792e8d2152bcad47 /src/station_cmd.cpp
parentc988b4d62ba08ee6a5efa44e0fa10da59dff4ae8 (diff)
downloadopenttd-f84a466ca516136de218bc599bbfaf8c909829f4.tar.xz
Fix #7945: Add cost of clearing the sloped tile when placing a dock (#7947)
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r--src/station_cmd.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 735edd06f..d06178fc4 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -2535,8 +2535,10 @@ CommandCost CmdBuildDock(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
if (IsBridgeAbove(tile)) return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST);
+ CommandCost cost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_STATION_DOCK]);
ret = DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
if (ret.Failed()) return ret;
+ cost.AddCost(ret);
TileIndex tile_cur = tile + TileOffsByDiagDir(direction);
@@ -2591,7 +2593,7 @@ CommandCost CmdBuildDock(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
st->AfterStationTileSetChange(true, STATION_DOCK);
}
- return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_STATION_DOCK]);
+ return cost;
}
void RemoveDockingTile(TileIndex t)