mirror of
https://github.com/GTAmodding/re3.git
synced 2025-10-14 10:31:35 +00:00
Fix some auto-aim problems
This commit is contained in:
parent
8b7f469ae1
commit
0256790e1c
2 changed files with 11 additions and 5 deletions
|
@ -205,9 +205,15 @@ CPedIK::PointGunInDirection(float targetYaw, float targetPitch)
|
|||
else if (status == ANGLES_SET_EXACTLY)
|
||||
m_flags |= GUN_POINTED_SUCCESSFULLY;
|
||||
}
|
||||
RwMatrix *m = GetBoneMatrix(m_ped, BONE_spine); // BUG: game uses index 2 directly, which happens to be identical to BONE_spine
|
||||
#ifdef FIX_BUGS
|
||||
RwMatrix *m = GetBoneMatrix(m_ped, BONE_spine);
|
||||
#else
|
||||
RpHAnimHierarchy* hier = GetAnimHierarchyFromSkinClump(m_ped->GetClump());
|
||||
RwMatrix *mats = RpHAnimHierarchyGetMatrixArray(hier);
|
||||
RwMatrix *m = &mats[2];
|
||||
#endif
|
||||
RwV3d axis = { 0.0f, 0.0f, 0.0f };
|
||||
float axisangle = -CGeneral::LimitRadianAngle(Atan2(-m->at.y, -m->at.x) - m_ped->m_fRotationCur);
|
||||
float axisangle = -CGeneral::LimitRadianAngle(Atan2(-m->up.y, -m->up.x) - m_ped->m_fRotationCur);
|
||||
axis.y = -Sin(axisangle);
|
||||
axis.z = Cos(axisangle);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue