ATC_mgr fix: clear user aircraft ATC on reposition
Avoids a stale controller causing crashes after a reposition. Triggered by C172 tutorials.
This commit is contained in:
parent
9f3f1a8f58
commit
d75f05d4c0
1 changed files with 8 additions and 4 deletions
|
@ -256,9 +256,13 @@ void FGATCManager::reposition()
|
|||
// available again. postinit() will recompute a new value if required
|
||||
FGAIManager* aiManager = globals->get_subsystem<FGAIManager>();
|
||||
auto userAircraft = aiManager->getUserAircraft();
|
||||
if (userAircraft && userAircraft->GetFlightPlan()) {
|
||||
auto userAIFP = userAircraft->GetFlightPlan();
|
||||
userAIFP->setGate({}); // clear any assignment
|
||||
if (userAircraft) {
|
||||
if (userAircraft->GetFlightPlan()) {
|
||||
auto userAIFP = userAircraft->GetFlightPlan();
|
||||
userAIFP->setGate({}); // clear any assignment
|
||||
}
|
||||
|
||||
userAircraft->clearATCController();
|
||||
}
|
||||
|
||||
postinit(); // critical for position-init logic
|
||||
|
|
Loading…
Reference in a new issue