diff options
author | alberth <alberth@openttd.org> | 2010-03-13 17:11:28 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2010-03-13 17:11:28 +0000 |
commit | 7cc68f493d10ed81d24b9e7a0e9631436643869f (patch) | |
tree | 1f7fef2560b9bc81461bd8f17f21bdc1d80c2a91 /src/vehicle.cpp | |
parent | 19afc9fdc0f009c93f31ea8fccdf95ce1372cc58 (diff) | |
download | openttd-7cc68f493d10ed81d24b9e7a0e9631436643869f.tar.xz |
(svn r19405) -Codechange: CheckOwnership() returns a CommandCost.
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r-- | src/vehicle.cpp | 5 |
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; |