Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix: Fix bugs in airport finite state machines #7710
Upon looking into #6219 I found that there were some issues with the finite state machines for the airports.
I have corrected the behaviour on a commuter airport of a helicopter in a hangar trying to takeoff while the helipads - actually only helipad2 - are/is occupied. With the first commit, it can now takeoff from just outside the hangar. Please let me know if this is not expected behaviour.
Note that there may be similar issues with the other airports that have helipads. I know that the international airport has the same issue.
This pull request is currently a WIP. I'm creating it now as I would be grateful for any feedback/assistance.
Additionally, with the pull request I would like to remove some of the magic numbers used:
Finally, if anyone could answer the following, that would be great:
I had a chance to look at the code and found that AirportFindFreeTerminal() uses 255 to denote terminal groups (for example, international airports have 2 groups of 3 terminals each as indicated by the first entry in _airport_terminal_international). I believe that the 255 is used to route an aircraft to a specific terminal group. AirportFindFreeTerminal() loops through each terminal in each terminal group until it finds a free terminal. When
As far as I can tell, when
This pull request is now ready for review.
I believe the only whitespace changes are in airport.h. I followed the style that was already there: a space after the equals sign, and then align the commas vertically (moving the numbers with them if necessary). Let me know if that's not appropriate. I couldn't find it in the coding style guide.