Land activity: fix bug which causes crash in Aircraft.AddInflunce()#21346
Merged
Conversation
Contributor
|
Can confirm that it fixes the crash, and the explanation/fix makes sense to me. |
PunkPun
reviewed
Feb 18, 2024
c687eb2 to
11ae56a
Compare
atlimit8
requested changes
Feb 18, 2024
Member
atlimit8
left a comment
There was a problem hiding this comment.
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
atlimit8
previously requested changes
Feb 18, 2024
Member
atlimit8
left a comment
There was a problem hiding this comment.
Minor copy-pasta on the comment change.
atlimit8
reviewed
Feb 18, 2024
4986ed0 to
3b03d5a
Compare
PunkPun
approved these changes
Feb 19, 2024
Member
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Landactivity 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.