summaryrefslogtreecommitdiffstats
path: root/src/peds/PedFight.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/peds/PedFight.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/peds/PedFight.cpp b/src/peds/PedFight.cpp
index 13d3930c..03d5c755 100644
--- a/src/peds/PedFight.cpp
+++ b/src/peds/PedFight.cpp
@@ -311,9 +311,14 @@ CPed::SetAttack(CEntity *victim)
m_pLookTarget->RegisterReference((CEntity **) &m_pLookTarget);
m_pSeekTarget->RegisterReference((CEntity **) &m_pSeekTarget);
}
+
if (m_pLookTarget) {
SetAimFlag(m_pLookTarget);
+#ifdef FREE_CAM
+ } else if (this != FindPlayerPed() || !((CPlayerPed*)this)->m_bFreeAimActive) {
+#else
} else {
+#endif
SetAimFlag(m_fRotationCur);
if (FindPlayerPed() == this && TheCamera.Cams[0].Using3rdPersonMouseCam())
@@ -737,6 +742,15 @@ CPed::Attack(void)
weaponAnimAssoc->flags &= ~ASSOC_RUNNING;
SetPointGunAt(m_pPointGunAt);
#endif
+#ifdef FREE_CAM
+ } else if (IsPlayer() && ((CPlayerPed*)this)->m_bFreeAimActive && GetWeapon()->m_eWeaponState != WEAPONSTATE_RELOADING) {
+ float limitedCam = CGeneral::LimitRadianAngle(-TheCamera.Orientation);
+ SetLookFlag(limitedCam, true);
+ SetAimFlag(limitedCam);
+ SetLookTimer(INT32_MAX);
+ SetPointGunAt(nil);
+ ((CPlayerPed*)this)->m_fFPSMoveHeading = TheCamera.Find3rdPersonQuickAimPitch();
+#endif
} else {
ClearAimFlag();