(svn r19372) -Codechange: CheckTileOwnership() returns a CommandCost.

This commit is contained in:
alberth
2010-03-07 20:44:05 +00:00
parent 8f335d4cbd
commit 40f106ba7c
7 changed files with 74 additions and 26 deletions

View File

@@ -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();