mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-29 01:19:11 +00:00
(svn r15355) -Codechange: simplify some stuff now ->FirstShared returns non-NULL again.
This commit is contained in:
@@ -40,12 +40,7 @@ AIVehicleList_SharedOrders::AIVehicleList_SharedOrders(VehicleID vehicle_id)
|
|||||||
{
|
{
|
||||||
if (!AIVehicle::IsValidVehicle(vehicle_id)) return;
|
if (!AIVehicle::IsValidVehicle(vehicle_id)) return;
|
||||||
|
|
||||||
Vehicle *v = GetVehicle(vehicle_id)->FirstShared();
|
for (const Vehicle *v = GetVehicle(vehicle_id)->FirstShared(); v != NULL; v->NextShared()) {
|
||||||
if (v == NULL) {
|
|
||||||
this->AddItem(vehicle_id);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
for (; v != NULL; v->NextShared()) {
|
|
||||||
this->AddItem(v->index);
|
this->AddItem(v->index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user