forked from mirror/OpenTTD
(svn r19405) -Codechange: CheckOwnership() returns a CommandCost.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user