diff --git a/regression/regression/result.txt b/regression/regression/result.txt index 52d957faf9..2153cdaade 100644 --- a/regression/regression/result.txt +++ b/regression/regression/result.txt @@ -7327,7 +7327,7 @@ ERROR: IsEnd() is invalid as Begin() is never called IsBuoyTile(): true IsLockTile(): true IsCanalTile(): true - GetBankBalance(): 1999965070 + GetBankBalance(): 1999965040 --AIWaypointList(BUOY)-- Count(): 1 @@ -7346,7 +7346,7 @@ ERROR: IsEnd() is invalid as Begin() is never called IsBuoyTile(): false IsLockTile(): false IsCanalTile(): false - GetBankBalance(): 1999959675 + GetBankBalance(): 1999959645 BuildWaterDepot(): true BuildDock(): true diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 735edd06f6..d06178fc40 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)