SG_LOG(SG_GENERAL, SG_BULK, "Scheduling Flights for : " << modelPath << " " << registration << " " << homePort);
FGScheduledFlight *flight = NULL;
do {
- if (currentDestination.empty()) {
- //flight = findAvailableFlight(userPort, flightIdentifier, now, (now+1800));
- if (!flight)
- flight = findAvailableFlight(currentDestination, flightIdentifier);
- } else {
- flight = findAvailableFlight(currentDestination, flightIdentifier);
- }
+ flight = findAvailableFlight(currentDestination, flightIdentifier);
if (!flight) {
break;
}
- if (startingPort.empty()) {
- startingPort = flight->getDepartureAirport()->getId();
- }
currentDestination = flight->getArrivalAirport()->getId();
<< " " << arrT << ":");
flights.push_back(flight);
- } while (currentDestination != startingPort);
+ } while (currentDestination != homePort);
SG_LOG(SG_GENERAL, SG_BULK, " Done ");
}
//cerr << "Processing << " << (*currAircraft)->getRegistration() << " with score " << (*currAircraft)->getScore() << endl;
if (!((*currAircraft)->update(now, userCart))) {
(*currAircraft)->taint();
- // NOTE: With traffic manager II, this statement below is no longer true
- // after proper initialization, we shouldnt get here.
- // But let's make sure
- //SG_LOG( SG_GENERAL, SG_ALERT, "Failed to update aircraft schedule in traffic manager");
}
currAircraft++;
}