diff options
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; +} |