diff options
author | alberth <alberth@openttd.org> | 2010-03-14 12:58:51 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2010-03-14 12:58:51 +0000 |
commit | 3b367ab708fa6115887752869d66b902c529b9fc (patch) | |
tree | f49477d3efbd413059bd0a0b8d906414d9bb8b60 /src/station_cmd.cpp | |
parent | 777123c228e163c976303be0588093732816f8ca (diff) | |
download | openttd-3b367ab708fa6115887752869d66b902c529b9fc.tar.xz |
(svn r19415) -Codechange: Forward CommandCost with an error back to the caller.
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r-- | src/station_cmd.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 40efc314c..956079d42 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -2383,7 +2383,9 @@ CommandCost CmdBuildDock(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 if (MayHaveBridgeAbove(tile) && IsBridgeAbove(tile)) return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST); - if (DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR).Failed()) return CMD_ERROR; + ret = DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); + ret.SetGlobalErrorMessage(); + if (ret.Failed()) return ret; TileIndex tile_cur = tile + TileOffsByDiagDir(direction); @@ -2396,7 +2398,9 @@ 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); - if (DoCommand(tile_cur, 0, 0, flags, CMD_LANDSCAPE_CLEAR).Failed()) return CMD_ERROR; + ret = DoCommand(tile_cur, 0, 0, flags, CMD_LANDSCAPE_CLEAR); + ret.SetGlobalErrorMessage(); + if (ret.Failed()) return ret; tile_cur += TileOffsByDiagDir(direction); if (!IsTileType(tile_cur, MP_WATER) || GetTileSlope(tile_cur, NULL) != SLOPE_FLAT) { |