Fix smooth spray when shooting with colt or usi while using PC controls

This commit is contained in:
Sergeanur 2021-07-26 09:13:16 +03:00
parent cafc0f3c10
commit bc3734cae3
2 changed files with 14 additions and 0 deletions

View File

@ -1348,6 +1348,9 @@ CPed::CalculateNewVelocity(void)
limitedRotDest -= 2 * PI; limitedRotDest -= 2 * PI;
} }
#ifdef FREE_CAM
if (!TheCamera.Cams[0].Using3rdPersonMouseCam())
#endif
if (IsPlayer() && m_nPedState == PED_ATTACK) if (IsPlayer() && m_nPedState == PED_ATTACK)
headAmount /= 4.0f; headAmount /= 4.0f;

View File

@ -503,6 +503,10 @@ CPlayerPed::DoWeaponSmoothSpray(void)
{ {
if (m_nPedState == PED_ATTACK && !m_pPointGunAt) { if (m_nPedState == PED_ATTACK && !m_pPointGunAt) {
eWeaponType weapon = GetWeapon()->m_eWeaponType; eWeaponType weapon = GetWeapon()->m_eWeaponType;
#ifdef FREE_CAM
if(TheCamera.Cams[0].Using3rdPersonMouseCam() && (weapon == WEAPONTYPE_COLT45 || weapon == WEAPONTYPE_UZI))
return false;
#endif
if (weapon == WEAPONTYPE_FLAMETHROWER || weapon == WEAPONTYPE_COLT45 || weapon == WEAPONTYPE_UZI || weapon == WEAPONTYPE_SHOTGUN || if (weapon == WEAPONTYPE_FLAMETHROWER || weapon == WEAPONTYPE_COLT45 || weapon == WEAPONTYPE_UZI || weapon == WEAPONTYPE_SHOTGUN ||
weapon == WEAPONTYPE_AK47 || weapon == WEAPONTYPE_M16 || weapon == WEAPONTYPE_HELICANNON) weapon == WEAPONTYPE_AK47 || weapon == WEAPONTYPE_M16 || weapon == WEAPONTYPE_HELICANNON)
return true; return true;
@ -1183,6 +1187,13 @@ CPlayerPed::PlayerControlZelda(CPad *padUsed)
padMoveInGameUnit = CVector2D(leftRight, upDown).Magnitude() / PAD_MOVE_TO_GAME_WORLD_MOVE; padMoveInGameUnit = CVector2D(leftRight, upDown).Magnitude() / PAD_MOVE_TO_GAME_WORLD_MOVE;
} }
#ifdef FREE_CAM
if(TheCamera.Cams[0].Using3rdPersonMouseCam() && doSmoothSpray) {
padMoveInGameUnit = 0.0f;
smoothSprayWithoutMove = false;
}
#endif
if (padMoveInGameUnit > 0.0f || smoothSprayWithoutMove) { if (padMoveInGameUnit > 0.0f || smoothSprayWithoutMove) {
float padHeading = CGeneral::GetRadianAngleBetweenPoints(0.0f, 0.0f, -leftRight, upDown); float padHeading = CGeneral::GetRadianAngleBetweenPoints(0.0f, 0.0f, -leftRight, upDown);
float neededTurn = CGeneral::LimitRadianAngle(padHeading - camOrientation); float neededTurn = CGeneral::LimitRadianAngle(padHeading - camOrientation);