Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Fix smooth spray when shooting with colt or usi while using PC controls
  • Loading branch information
Sergeanur committed Jul 26, 2021
1 parent cafc0f3 commit bc3734cae3aeb6334314b67951eb31d7dd6c14d6
Showing with 14 additions and 0 deletions.
  1. +3 −0 src/peds/Ped.cpp
  2. +11 −0 src/peds/PlayerPed.cpp
@@ -1348,6 +1348,9 @@ CPed::CalculateNewVelocity(void)
limitedRotDest -= 2 * PI;
}

#ifdef FREE_CAM
if (!TheCamera.Cams[0].Using3rdPersonMouseCam())
#endif
if (IsPlayer() && m_nPedState == PED_ATTACK)
headAmount /= 4.0f;

@@ -503,6 +503,10 @@ CPlayerPed::DoWeaponSmoothSpray(void)
{
if (m_nPedState == PED_ATTACK && !m_pPointGunAt) {
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 ||
weapon == WEAPONTYPE_AK47 || weapon == WEAPONTYPE_M16 || weapon == WEAPONTYPE_HELICANNON)
return true;
@@ -1183,6 +1187,13 @@ CPlayerPed::PlayerControlZelda(CPad *padUsed)
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) {
float padHeading = CGeneral::GetRadianAngleBetweenPoints(0.0f, 0.0f, -leftRight, upDown);
float neededTurn = CGeneral::LimitRadianAngle(padHeading - camOrientation);

1 comment on commit bc3734c

@yasinkaraaslan

This comment has been minimized.

Copy link

@yasinkaraaslan yasinkaraaslan commented on bc3734c Jul 27, 2021

Finally! @erorcun :)

Please sign in to comment.