New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Fix bugs in airport finite state machines #7710
Conversation
i haven't looked at the code, but my first guess would be some kind of |
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 |
Previously, a helicopter in the hangar of a commuter airport would have to wait until HELIPAD2 was free before it could takeoff. Now, a helicopter in the hangar can takeoff from just outside the hangar.
This pull request is now ready for review. In summary:
|
Structurally this PR looks reasonable, but I'll have to dedicate some time to playtest it before giving a review. |
There seem to be a few changes that are just whitespace, make sure these are following our code style for indentation (difficult to judge from the github interface) |
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. |
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.
Probably fine, can always be reverted if not :)
Helicopters can now take off from just outside the hangars.
Squashed the realignment and reversion commits into 5db82f7 |
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:
heading
variable (TO_ALL)heading
variable (unsure)block
variable (unsure)Finally, if anyone could answer the following, that would be great:
heading
variable?