diff options
Diffstat (limited to 'src/waypoint_cmd.cpp')
-rw-r--r-- | src/waypoint_cmd.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/waypoint_cmd.cpp b/src/waypoint_cmd.cpp index 413d7be66..7be4a6ce4 100644 --- a/src/waypoint_cmd.cpp +++ b/src/waypoint_cmd.cpp @@ -179,7 +179,10 @@ static CommandCost IsValidTileForWaypoint(TileIndex tile, Axis axis, StationID * Owner owner = GetTileOwner(tile); if (!CheckOwnership(owner)) return CMD_ERROR; - if (!EnsureNoVehicleOnGround(tile)) return CMD_ERROR; + + CommandCost ret = EnsureNoVehicleOnGround(tile); + ret.SetGlobalErrorMessage(); + if (ret.Failed()) return ret; Slope tileh = GetTileSlope(tile, NULL); if (tileh != SLOPE_FLAT && @@ -390,7 +393,11 @@ CommandCost RemoveBuoy(TileIndex tile, DoCommandFlag flags) if (HasStationInUse(wp->index, INVALID_COMPANY)) return_cmd_error(STR_ERROR_BUOY_IS_IN_USE); /* remove the buoy if there is a ship on tile when company goes bankrupt... */ - if (!(flags & DC_BANKRUPT) && !EnsureNoVehicleOnGround(tile)) return CMD_ERROR; + if (!(flags & DC_BANKRUPT)) { + CommandCost ret = EnsureNoVehicleOnGround(tile); + ret.SetGlobalErrorMessage(); + if (ret.Failed()) return ret; + } if (flags & DC_EXEC) { wp->facilities &= ~FACIL_DOCK; |