Changeset - r11233:8f3d3e8e59f0
[Not reviewed]
master
0 1 0
yexo - 15 years ago 2009-02-26 07:30:13
yexo@openttd.org
(svn r15587) -Fix (r15345): I should really test even those simple api functions better.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/ai/api/ai_vehiclelist.cpp
Show inline comments
 
@@ -19,28 +19,28 @@ AIVehicleList::AIVehicleList()
 
AIVehicleList_Station::AIVehicleList_Station(StationID station_id)
 
{
 
	if (!AIStation::IsValidStation(station_id)) return;
 

	
 
	Vehicle *v;
 

	
 
	FOR_ALL_VEHICLES(v) {
 
		if (v->owner == _current_company && v->IsPrimaryVehicle()) {
 
			const Order *order;
 

	
 
			FOR_VEHICLE_ORDERS(v, order) {
 
				if (order->IsType(OT_GOTO_STATION) && order->GetDestination() == station_id) {
 
					this->AddItem(v->index);
 
					break;
 
				}
 
			}
 
		}
 
	}
 
}
 

	
 
AIVehicleList_SharedOrders::AIVehicleList_SharedOrders(VehicleID vehicle_id)
 
{
 
	if (!AIVehicle::IsValidVehicle(vehicle_id)) return;
 

	
 
	for (const Vehicle *v = GetVehicle(vehicle_id)->FirstShared(); v != NULL; v->NextShared()) {
 
	for (const Vehicle *v = GetVehicle(vehicle_id)->FirstShared(); v != NULL; v = v->NextShared()) {
 
		this->AddItem(v->index);
 
	}
 
}
0 comments (0 inline, 0 general)