summaryrefslogtreecommitdiff
path: root/src/ai/api/ai_vehicle.cpp
diff options
context:
space:
mode:
authorYexo <yexo@openttd.org>2009-02-05 01:12:49 +0000
committerYexo <yexo@openttd.org>2009-02-05 01:12:49 +0000
commit62a11eb5a93a12994bdf84475930d0d4b7fb4315 (patch)
tree6b29d7d897ad9b7e9938b372fd066771967fc2db /src/ai/api/ai_vehicle.cpp
parent364e2a110dba0c792864e55d55804681c8eb9bca (diff)
downloadopenttd-62a11eb5a93a12994bdf84475930d0d4b7fb4315.tar.xz
(svn r15345) -Add [NoAI]: Add AIVehicle::HasSharedOrders() and AIVehicleList_SharedOrders.
Diffstat (limited to 'src/ai/api/ai_vehicle.cpp')
-rw-r--r--src/ai/api/ai_vehicle.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ai/api/ai_vehicle.cpp b/src/ai/api/ai_vehicle.cpp
index 18e17221d..8951cb5f2 100644
--- a/src/ai/api/ai_vehicle.cpp
+++ b/src/ai/api/ai_vehicle.cpp
@@ -390,3 +390,11 @@
default: NOT_REACHED();
}
}
+
+/* static */ bool AIVehicle::HasSharedOrders(VehicleID vehicle_id)
+{
+ if (!IsValidVehicle(vehicle_id)) return false;
+
+ Vehicle *v = ::GetVehicle(vehicle_id);
+ return v->orders.list != NULL && v->orders.list->GetNumVehicles() > 1;
+}