Add better comments to attach natives and rename params to more accurate ones#239
Open
kagikn wants to merge 1 commit intoalloc8or:masterfrom
Open
Add better comments to attach natives and rename params to more accurate ones#239kagikn wants to merge 1 commit intoalloc8or:masterfrom
kagikn wants to merge 1 commit intoalloc8or:masterfrom
Conversation
…ate ones Add better comments so you can use camera attach natives without wild guessing. Rename inaccurate params to more accurate ones as well. ATTACH_ENTITY_BONE_TO_ENTITY_BONE has a critical issue, so I add a warning note, as well as renaming 2 bools to descriptive params. The docs of ATTACH_ENTITY_BONE_TO_ENTITY_BONE natives are incorrect in the last 2 params in commands_entity.sch, so took more appropriate param names from ATTACH_ENTITY_TO_ENTITY.
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 is mainly for camera attachment natives, but also includes changes for
ATTACH_ENTITY_BONE_TO_ENTITY_BONEsince it has a critical bug. Adds better comments so you can use camera attach natives without wild guessing. Also renames inaccurate params to more accurate ones as well.Renames
boneIndexparam ofATTACH_CAM_TO_PED_BONEandHARD_ATTACH_CAM_TO_PED_BONEtoboneIdsince it takes a bone tag value (not index of its skeleton) but typically namedboneIdin this DB.Just in case you are wondering how "hard attachment" of
camScriptedCameraworks, you can search for "0F 84 89 00 00 00 F3 0F 10 83" for a related place in a camera update function (I think, at leastcamScriptedCamerahas a pointer to this function in its vtable). The function considers the camera is hard attached to the entity that the cam is attached to when the 6th bit is set. You can find an address in all versions since b1180 whereHARD_ATTACH_CAM_TO_PED_BONEis introduced.