summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ai/api/ai_vehiclelist.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/ai/api/ai_vehiclelist.cpp b/src/ai/api/ai_vehiclelist.cpp
index 1c099910b..a08357b06 100644
--- a/src/ai/api/ai_vehiclelist.cpp
+++ b/src/ai/api/ai_vehiclelist.cpp
@@ -40,12 +40,7 @@ AIVehicleList_SharedOrders::AIVehicleList_SharedOrders(VehicleID vehicle_id)
{
if (!AIVehicle::IsValidVehicle(vehicle_id)) return;
- Vehicle *v = GetVehicle(vehicle_id)->FirstShared();
- if (v == NULL) {
- this->AddItem(vehicle_id);
- return;
- }
- for (; v != NULL; v->NextShared()) {
+ for (const Vehicle *v = GetVehicle(vehicle_id)->FirstShared(); v != NULL; v->NextShared()) {
this->AddItem(v->index);
}
}