diff options
author | alberth <alberth@openttd.org> | 2010-03-07 20:44:05 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2010-03-07 20:44:05 +0000 |
commit | 40f106ba7c2b0055f61e652674701bce53fb06a6 (patch) | |
tree | 4762f0523de8c1b7c40f469f9cee3ea8cb1b5a1e /src/road_cmd.cpp | |
parent | 8f335d4cbd46ef88fabd476a747cf0d4dc18add2 (diff) | |
download | openttd-40f106ba7c2b0055f61e652674701bce53fb06a6.tar.xz |
(svn r19372) -Codechange: CheckTileOwnership() returns a CommandCost.
Diffstat (limited to 'src/road_cmd.cpp')
-rw-r--r-- | src/road_cmd.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index 0f6cc1581..366f6bd0c 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -911,7 +911,11 @@ CommandCost CmdBuildRoadDepot(TileIndex tile, DoCommandFlag flags, uint32 p1, ui static CommandCost RemoveRoadDepot(TileIndex tile, DoCommandFlag flags) { - if (!CheckTileOwnership(tile) && _current_company != OWNER_WATER) return CMD_ERROR; + if (_current_company != OWNER_WATER) { + CommandCost ret = CheckTileOwnership(tile); + ret.SetGlobalErrorMessage(); + if (ret.Failed()) return ret; + } CommandCost ret = EnsureNoVehicleOnGround(tile); ret.SetGlobalErrorMessage(); |