mirror of https://github.com/OpenTTD/OpenTTD
(svn r15355) -Codechange: simplify some stuff now ->FirstShared returns non-NULL again.
parent
b7c7a1f701
commit
8fb4962407
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue