summaryrefslogtreecommitdiff
path: root/src/ai/api/ai_vehicle.cpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2009-04-26 16:14:53 +0000
committeryexo <yexo@openttd.org>2009-04-26 16:14:53 +0000
commit9101de49d8fbc0b1f5e067ca2cd8c5906f30e84a (patch)
treeb441111de37f81dab27a535c5c3fe41360ba5fc6 /src/ai/api/ai_vehicle.cpp
parent779640b53a212091e929a2d7603474ab7b2710f8 (diff)
downloadopenttd-9101de49d8fbc0b1f5e067ca2cd8c5906f30e84a.tar.xz
(svn r16165) -Add [FS#2801] [NoAI]: several functions to AIOrder to check the what kind of order an order is.
-Fix: AIOrder::GetOrderDestination and AIOrder::GetOrderFlags didn't work on ORDER_CURRENT when the vehicle was loading/leaving in a station.
Diffstat (limited to 'src/ai/api/ai_vehicle.cpp')
-rw-r--r--src/ai/api/ai_vehicle.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ai/api/ai_vehicle.cpp b/src/ai/api/ai_vehicle.cpp
index d0f62136f..130ebe05e 100644
--- a/src/ai/api/ai_vehicle.cpp
+++ b/src/ai/api/ai_vehicle.cpp
@@ -160,6 +160,13 @@
return AIObject::DoCommand(0, vehicle_id, 0, GetCmdSendToDepot(::GetVehicle(vehicle_id)));
}
+/* static */ bool AIVehicle::SendVehicleToDepotForServicing(VehicleID vehicle_id)
+{
+ EnforcePrecondition(false, IsValidVehicle(vehicle_id));
+
+ return AIObject::DoCommand(0, vehicle_id, DEPOT_SERVICE, GetCmdSendToDepot(::GetVehicle(vehicle_id)));
+}
+
/* static */ bool AIVehicle::IsInDepot(VehicleID vehicle_id)
{
if (!IsValidVehicle(vehicle_id)) return false;