Fix smooth spray when using chainsaw or when you stop shooting while using free camera and PC controls

This commit is contained in:
Sergeanur 2021-07-26 09:54:04 +03:00
parent 250727c9ca
commit 371f1be9b3

View File

@ -574,8 +574,12 @@ CPlayerPed::DoWeaponSmoothSpray(void)
return -1.0f; return -1.0f;
case WEAPONTYPE_CHAINSAW: case WEAPONTYPE_CHAINSAW:
if (GetMeleeStartAnim(weaponInfo) && RpAnimBlendClumpGetAssociation(GetClump(), GetMeleeStartAnim(weaponInfo))) if (GetMeleeStartAnim(weaponInfo) && RpAnimBlendClumpGetAssociation(GetClump(), GetMeleeStartAnim(weaponInfo))) {
#ifdef FREE_CAM
if (TheCamera.Cams[0].Using3rdPersonMouseCam()) return -1.0f;
#endif
return PI / 128.0f; return PI / 128.0f;
}
else if (GetFireAnimGround(weaponInfo, false) && RpAnimBlendClumpGetAssociation(GetClump(), GetFireAnimGround(weaponInfo, false))) else if (GetFireAnimGround(weaponInfo, false) && RpAnimBlendClumpGetAssociation(GetClump(), GetFireAnimGround(weaponInfo, false)))
return PI / 176.f; return PI / 176.f;
else else
@ -1475,6 +1479,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() && smoothSprayRate > 0.0f) {
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);