summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorerorcun <erorcunerorcun@hotmail.com.tr>2021-08-22 11:23:12 +0200
committererorcun <erorcunerorcun@hotmail.com.tr>2021-08-22 11:23:12 +0200
commit285fee01f2a0e2161ef19d9dbfabb957d1374ab7 (patch)
treec3a25c832750c8bf69c9f2ac8fd3c7d6293a948f
parentAdd forgotten bit from X11 detection (diff)
downloadre3-285fee01f2a0e2161ef19d9dbfabb957d1374ab7.tar
re3-285fee01f2a0e2161ef19d9dbfabb957d1374ab7.tar.gz
re3-285fee01f2a0e2161ef19d9dbfabb957d1374ab7.tar.bz2
re3-285fee01f2a0e2161ef19d9dbfabb957d1374ab7.tar.lz
re3-285fee01f2a0e2161ef19d9dbfabb957d1374ab7.tar.xz
re3-285fee01f2a0e2161ef19d9dbfabb957d1374ab7.tar.zst
re3-285fee01f2a0e2161ef19d9dbfabb957d1374ab7.zip
-rw-r--r--src/peds/PedIK.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/peds/PedIK.cpp b/src/peds/PedIK.cpp
index 3bc5796b..ea3cf1aa 100644
--- a/src/peds/PedIK.cpp
+++ b/src/peds/PedIK.cpp
@@ -205,6 +205,8 @@ CPedIK::PointGunInDirection(float targetYaw, float targetPitch)
else if (status == ANGLES_SET_EXACTLY)
m_flags |= GUN_POINTED_SUCCESSFULLY;
}
+
+ // Game uses index 2 directly, which happens to be identical to BONE_spine
#ifdef FIX_BUGS
RwMatrix *m = GetBoneMatrix(m_ped, BONE_spine);
#else
@@ -213,7 +215,7 @@ CPedIK::PointGunInDirection(float targetYaw, float targetPitch)
RwMatrix *m = &mats[2];
#endif
RwV3d axis = { 0.0f, 0.0f, 0.0f };
- float axisangle = -CGeneral::LimitRadianAngle(Atan2(-m->up.y, -m->up.x) - m_ped->m_fRotationCur);
+ float axisangle = -CGeneral::LimitRadianAngle(Atan2(-m->at.y, -m->at.x) - m_ped->m_fRotationCur);
axis.y = -Sin(axisangle);
axis.z = Cos(axisangle);