diff options
author | Yexo <Yexo@openttd.org> | 2009-02-05 01:12:49 +0000 |
---|---|---|
committer | Yexo <Yexo@openttd.org> | 2009-02-05 01:12:49 +0000 |
commit | 8f51ee50c1d810a7472ed8a0194f2a6c36b36b99 (patch) | |
tree | 6b29d7d897ad9b7e9938b372fd066771967fc2db /src/ai/api/ai_vehicle.cpp | |
parent | 85594561e0cff8553f14b14d7cc37556b0243a92 (diff) | |
download | openttd-8f51ee50c1d810a7472ed8a0194f2a6c36b36b99.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.cpp | 8 |
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; +} |