Common - Add loading of dead units into vehicles#11372
Draft
Dystopian wants to merge 5 commits into
Draft
Conversation
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.
When merged this pull request will:
fnc_nearestVehiclesFreeSeat(ignore dead, locked, flipped, and simulation-disabled vehicles);distancechecks withfnc_getInteractionDistanceindraggingfunctions and reduce max load distance from 5 to 2.The implementation uses moveInAny. To target specific seats, temporary local units are spawned to probe seat positions.
The distance check was adjusted because the previous distance check made it difficult to load carried units into larger vehicles (e.g. trucks, aircraft).
moveInAnyhas a limitation for cargo seats: it places the unit into the seat with Position Number equal to the current number of cargo units, even if that seat is locked or already occupied.This implementation includes a workaround: it uses temporary units and
moveInCargoto shift themoveInAnyposition forward. However, it is not possible to shift it backwards. An approach based on pre-moveOutof units seems to be too buggy. As a result, in some cases loading into cargo may silently fail.The main problem with cargo is reported in https://feedback.bistudio.com/T198758 and fixed in DEV 2.21.153732. Revision e373abf can run only on DEV. 3438b34 can still be used in 2.20.
Feedback is welcome, especially on naming and comments.