From aec797671e7ae079556d7629dafa159b1431364d Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Thu, 22 Jul 2021 22:15:27 +0300 Subject: [PATCH] Fix aiming with minigun and flamethrower with PC controls --- src/control/Script5.cpp | 2 +- src/peds/PedFight.cpp | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/control/Script5.cpp b/src/control/Script5.cpp index 25b29256..f65724c2 100644 --- a/src/control/Script5.cpp +++ b/src/control/Script5.cpp @@ -1913,7 +1913,7 @@ bool CRunningScript::CheckDamagedWeaponType(int32 actual, int32 type) if (type == WEAPONTYPE_ANYMELEE) { if (actual <= WEAPONTYPE_CHAINSAW) return true; - if (actual - WEAPONTYPE_GRENADE <= WEAPONTYPE_MINIGUN) + if (actual >= WEAPONTYPE_GRENADE && actual <= WEAPONTYPE_UNIDENTIFIED) return false; return false; } diff --git a/src/peds/PedFight.cpp b/src/peds/PedFight.cpp index 8e377c81..20df6553 100644 --- a/src/peds/PedFight.cpp +++ b/src/peds/PedFight.cpp @@ -352,6 +352,14 @@ CPed::SetAttack(CEntity *victim) SetAimFlag(m_fRotationCur); } } +#ifdef FIX_BUGS + // fix aiming for flamethrower and minigun while using PC controls + else if (curWeapon->m_AnimToPlay == ASSOCGRP_FLAMETHROWER && TheCamera.Cams[0].Using3rdPersonMouseCam() && this == FindPlayerPed()) + { + SetAimFlag(m_fRotationCur); + ((CPlayerPed*)this)->m_fFPSMoveHeading = TheCamera.Find3rdPersonQuickAimPitch(); + } +#endif if (m_nPedState == PED_ATTACK) { bIsAttacking = true; return;