Guard against a possible crash in TowerController
This commit is contained in:
parent
2cca2c0b4e
commit
90f14626f5
1 changed files with 6 additions and 3 deletions
|
@ -1027,10 +1027,13 @@ void FGTowerController::updateAircraftInformation(int id, double lat, double lon
|
||||||
} */
|
} */
|
||||||
// only bother with aircraft that have a takeoff status of 2, since those are essentially under tower control
|
// only bother with aircraft that have a takeoff status of 2, since those are essentially under tower control
|
||||||
FGAIAircraft* ac= rwy->getFirstAircraftIndepartureQueue();
|
FGAIAircraft* ac= rwy->getFirstAircraftIndepartureQueue();
|
||||||
|
if (ac) {
|
||||||
if (ac->getTakeOffStatus() == 1) {
|
if (ac->getTakeOffStatus() == 1) {
|
||||||
// transmit takeoff clearance
|
// transmit takeoff clearance
|
||||||
ac->setTakeOffStatus(2);
|
ac->setTakeOffStatus(2);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (current.getAircraft()->getTakeOffStatus() == 2) {
|
if (current.getAircraft()->getTakeOffStatus() == 2) {
|
||||||
current.setHoldPosition(false);
|
current.setHoldPosition(false);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue