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 of ATTACH_CAM_TO_PED_BONE and HARD_ATTACH_CAM_TO_PED_BONE to boneId since it takes a bone tag value (not index of its skeleton) but typically named boneId 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 least camScriptedCamera 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 where HARD_ATTACH_CAM_TO_PED_BONE is introduced.
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.