Add better comments to attach natives and rename params to more accurate ones #239
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_BONE
since 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
boneIndex
param ofATTACH_CAM_TO_PED_BONE
andHARD_ATTACH_CAM_TO_PED_BONE
toboneId
since it takes a bone tag value (not index of its skeleton) but typically namedboneId
in this DB.Just in case you are wondering how "hard attachment" of
camScriptedCamera
works, 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 leastcamScriptedCamera
has 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_BONE
is introduced.