diff --git a/src/AIModel/AIAircraft.cxx b/src/AIModel/AIAircraft.cxx index 7068c6eb4..704c4c3c7 100644 --- a/src/AIModel/AIAircraft.cxx +++ b/src/AIModel/AIAircraft.cxx @@ -358,7 +358,9 @@ void FGAIAircraft::ProcessFlightPlan( double dt, time_t now ) { } announcePositionToController(); - + if (fp) { + props->getChild("arrivaltime", 0, true)->setIntValue(fp->getArrivalTime()); + } } if (next) { diff --git a/src/Traffic/Schedule.cxx b/src/Traffic/Schedule.cxx index 452c4b1c3..534db7bbf 100644 --- a/src/Traffic/Schedule.cxx +++ b/src/Traffic/Schedule.cxx @@ -383,6 +383,17 @@ bool FGAISchedule::createAIAircraft(FGScheduledFlight* flight, double speedKnots if (fp->isValidPlan()) { aiAircraft->FGAIBase::setFlightPlan(std::move(fp)); globals->get_subsystem()->attach(aiAircraft); + if (aiAircraft->_getProps()) { + SGPropertyNode *nodeofaircraft = aiAircraft->_getProps(); + if (dep) { + nodeofaircraft->getChild("departureairport", 0, true)->setStringValue(dep->getId()); + nodeofaircraft->getChild("departuretime", 0, true)->setIntValue(deptime); + } + if (arr) { + nodeofaircraft->getChild("arrivalairport", 0, true)->setStringValue(arr->getId()); + // arrival time not known here + } + } return true; } else { aiAircraft = NULL;