diff --git a/Source/Nakatomi/PlayerCharacter.cpp b/Source/Nakatomi/PlayerCharacter.cpp index 3846d19..5ef8455 100644 --- a/Source/Nakatomi/PlayerCharacter.cpp +++ b/Source/Nakatomi/PlayerCharacter.cpp @@ -298,22 +298,24 @@ void APlayerCharacter::QuitCallback(const FInputActionInstance& Instance) void APlayerCharacter::SetSprintingCallback(const FInputActionInstance& Instance) { - if (UNakatomiCMC* cmc = GetCharacterMovementComponent()) + UNakatomiCMC* cmc = GetCharacterMovementComponent(); + + if (!IsADS && cmc) { cmc->EnableSprint(); + IsSprinting = true; } - - IsSprinting = true; } void APlayerCharacter::SetWalkingCallback(const FInputActionInstance& Instance) { - if (UNakatomiCMC* cmc = GetCharacterMovementComponent()) + UNakatomiCMC* cmc = GetCharacterMovementComponent(); + + if (!IsADS && cmc) { cmc->DisableSprint(); + IsSprinting = false; } - - IsSprinting = false; } void APlayerCharacter::CalculateHits(TArray* hits) @@ -518,13 +520,18 @@ void APlayerCharacter::WeaponSwitchingCallback(const FInputActionInstance& Insta void APlayerCharacter::BeginAimDownSightsCallback(const FInputActionInstance& Instance) { - IsADS = true; + if (IsSprinting) + { + return; + } + IsADS = true; + if (UNakatomiCMC* cmc = GetCharacterMovementComponent()) { cmc->EnableAds(); } - + AimSensitivity = DefaultAimSensitivity * ADSAimSensitivityMultiplier; if (CurrentWeapon) @@ -544,6 +551,11 @@ void APlayerCharacter::BeginAimDownSightsCallback(const FInputActionInstance& In void APlayerCharacter::EndAimDownSightsCallback(const FInputActionInstance& Instance) { + if (IsSprinting) + { + return; + } + IsADS = false; if (UNakatomiCMC* cmc = GetCharacterMovementComponent())