src/ai/api/ai_stationlist.cpp
branchnoai
changeset 9745 fb2454d70f37
parent 9724 b39bc69bb2f2
child 9746 e4ab7ea8d897
equal deleted inserted replaced
9744:7297fcf46e03 9745:fb2454d70f37
    13 	FOR_ALL_STATIONS(st) {
    13 	FOR_ALL_STATIONS(st) {
    14 		if (st->owner == _current_player && (type == AIStation::STATION_ANY || (st->facilities & type) != 0)) this->AddItem(st->index);
    14 		if (st->owner == _current_player && (type == AIStation::STATION_ANY || (st->facilities & type) != 0)) this->AddItem(st->index);
    15 	}
    15 	}
    16 }
    16 }
    17 
    17 
    18 AIVehicleStationList::AIVehicleStationList(VehicleID vehicle_id)
    18 AIStationList_Vehicle::AIStationList_Vehicle(VehicleID vehicle_id) : AIStationList(AIStation::STATION_ANY)
    19 {
    19 {
       
    20 	this->Clear();
    20 	if (!AIVehicle::IsValidVehicle(vehicle_id)) return;
    21 	if (!AIVehicle::IsValidVehicle(vehicle_id)) return;
    21 
    22 
    22 	Vehicle *v = ::GetVehicle(vehicle_id);
    23 	Vehicle *v = ::GetVehicle(vehicle_id);
    23 
    24 
    24 	for (Order *o = v->orders; o != NULL; o = o->next) {
    25 	for (Order *o = v->orders; o != NULL; o = o->next) {