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
Land activity: fix bug which causes crash in Aircraft.AddInflunce() #21346
Conversation
Can confirm that it fixes the crash, and the explanation/fix makes sense to me. |
c687eb2
to
11ae56a
Compare
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.
Reviewed and tested. It fixes the adjacent force landing crash mentioned by @darkademic. Aborting here is the correct behavior regardless of the bug.
I have one nit about the comment wording; otherwise, I approve. 👍
11ae56a
to
4986ed0
Compare
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.
Minor copy-pasta on the comment change.
4986ed0
to
3b03d5a
Compare
This PR fixes #21302 by adding additional check in
Land.Tick()
for skipping landing mechanism, if the aircraft is already on the ground at target location.More details
Land
activity has an early check, if the aircraft is at the landing location:However, this can change, since the desired landing location can be occupied:
After new landing location is picked, the check isn't performed again and
Aircraft.AddInfluence()
can be called without callingAircraft.RemoveInfluence()
first.This can happen, if the aircraft is on the ground and force land order is issued to the adjacent cell, which is occupied (doesn't matter what kind of actor is on that cell). Since the aircraft does not take off first, when forcing the landing, but immediately attempts to land on the adjacent cell, it does not do the check mentioned above.
It is possible that an older issue #20459 is caused by the same bug as the crash described in #21302.