-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
15 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56ece3a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Folke,
Thanks for fixing this bug in my code! I hadn't realised that XPLMCountAircraft() could return more than 20, and don't have a TCAS generating plugin that would test this.
It occurs to me that the try/catch update should not be required as you are already making sure that otherAircraftCount is limited in the updatePlaneCount() function.
Mike
56ece3a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @mjh65,
no problem, I wasn't aware of this change in XPLMCountAircraft either. I think this is a rather recent change, I found some information here: https://developer.x-plane.com/article/overriding-tcas-and-providing-traffic-information/
But I didn't have time to fully understand that article yet, so for now it's enough to have this fixed.
You're right that the catch handler is currently superfluous. The idea was basically: If any part of the flight loop throws an unhandled exception, there should at least be some central catch handler so we don't crash X-Plane. That way, it's prepared for exceptions from future changes to the flight loop.
-- Folke