bugfix: Units located above the terrain can no longer teleport into airborne transports #1794
+10
−0
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.
Fixes #245
This change fixes an issue where units that are located above the terrain can be immediately teleported into airborne transports.
When an airborne transport unloads units, the transport is often not exactly level with the terrain at the time of unloading as the landed condition is based on a distance threshold to the landing location. This can result in disembarked units floating slightly above the terrain, which bypasses the condition on the transport having landed before embarking.
This is also why disembarked units often remain clumped together in the one spot, as this floating state cancels out pathfinding. The floating issue can be seen below.
FLOATY.mp4
Fixing the floating issue would also solve this issue, however it is still proper to ensure the z-bounds of the respective objects overlap before boarding can occur.
Before
Floating infantry can teleport back aboard the Chinook
TELEPORT.mp4
After
Floating infantry can not teleport back aboard the Chinook
NORMAL.mp4