double radius, int leg,
FGAIAircraft * aircraft)
{
+ if (!aircraft || !aircraft->getPerformance()) {
+ SG_LOG(SG_ATC, SG_ALERT, "announcePosition: missing aircraft performance");
+ return;
+ }
+
TrafficVectorIterator i = activeTraffic.begin();
// Search search if the current id alread has an entry
// This might be faster using a map instead of a vector, but let's start by taking a safe route
return true;
}
-time_t FGAISchedule::getDepartureTime() { return (*flights.begin())->getDepartureTime (); }
+time_t FGAISchedule::getDepartureTime()
+{
+ if (flights.empty())
+ return 0;
+
+ return (*flights.begin())->getDepartureTime ();
+}
+
+FGAirport *FGAISchedule::getDepartureAirport()
+{
+ if (flights.empty())
+ return 0;
+
+ return (*flights.begin())->getDepartureAirport();
+}
+
+FGAirport *FGAISchedule::getArrivalAirport()
+{
+ if (flights.empty())
+ return 0;
-FGAirport *FGAISchedule::getDepartureAirport() { return (*flights.begin())->getDepartureAirport(); }
+ return (*flights.begin())->getArrivalAirport ();
+}
-FGAirport *FGAISchedule::getArrivalAirport() { return (*flights.begin())->getArrivalAirport (); }
+int FGAISchedule::getCruiseAlt()
+{
+ if (flights.empty())
+ return 0;
-int FGAISchedule::getCruiseAlt() { return (*flights.begin())->getCruiseAlt (); }
+ return (*flights.begin())->getCruiseAlt ();
+}
-const std::string &FGAISchedule::getCallSign() { return (*flights.begin())->getCallSign (); }
+std::string FGAISchedule::getCallSign()
+{
+ if (flights.empty())
+ return std::string();
-const std::string &FGAISchedule::getFlightRules() { return (*flights.begin())->getFlightRules (); }
+ return (*flights.begin())->getCallSign ();
+}
+
+std::string FGAISchedule::getFlightRules()
+{
+ if (flights.empty())
+ return std::string();
+
+ return (*flights.begin())->getFlightRules ();
+}
FGScheduledFlight* FGAISchedule::findAvailableFlight (const string ¤tDestination,
const string &req,
const std::string& getFlightType () { return flightType;};
const std::string& getAirline () { return airline; };
const std::string& getAircraft () { return acType; };
- const std::string& getCallSign ();
+ std::string getCallSign ();
const std::string& getRegistration () { return registration;};
- const std::string& getFlightRules ();
+ std::string getFlightRules ();
bool getHeavy () { return heavy; };
double getCourse () { return courseToDest; };
unsigned int getRunCount () { return runCount; };