summaryrefslogtreecommitdiff
path: root/src/vehicle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r--src/vehicle.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index 44e3991ff..0797ee131 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -1665,7 +1665,10 @@ void Vehicle::HandleLoading(bool mode)
CommandCost Vehicle::SendToDepot(DoCommandFlag flags, DepotCommand command)
{
- if (!CheckOwnership(this->owner)) return CMD_ERROR;
+ CommandCost ret = CheckOwnership(this->owner);
+ ret.SetGlobalErrorMessage();
+ if (ret.Failed()) return ret;
+
if (this->vehstatus & VS_CRASHED) return CMD_ERROR;
if (this->IsStoppedInDepot()) return CMD_ERROR;