Merge movement-component #1

Merged
baz merged 20 commits from movement-component into master 2024-01-18 18:30:17 +01:00
1 changed files with 8 additions and 24 deletions
Showing only changes of commit 368575b715 - Show all commits

View File

@ -280,9 +280,7 @@ void APlayerCharacter::QuitCallback(const FInputActionInstance& Instance)
void APlayerCharacter::SetSprintingCallback(const FInputActionInstance& Instance) void APlayerCharacter::SetSprintingCallback(const FInputActionInstance& Instance)
{ {
UNakatomiCMC* cmc = GetCharacterMovementComponent(); if (UNakatomiCMC* cmc = GetCharacterMovementComponent())
if (cmc)
{ {
cmc->EnableSprint(); cmc->EnableSprint();
} }
@ -290,9 +288,7 @@ void APlayerCharacter::SetSprintingCallback(const FInputActionInstance& Instance
void APlayerCharacter::SetWalkingCallback(const FInputActionInstance& Instance) void APlayerCharacter::SetWalkingCallback(const FInputActionInstance& Instance)
{ {
UNakatomiCMC* cmc = GetCharacterMovementComponent(); if (UNakatomiCMC* cmc = GetCharacterMovementComponent())
if (cmc)
{ {
cmc->DisableSprint(); cmc->DisableSprint();
} }
@ -483,9 +479,7 @@ void APlayerCharacter::BeginAimDownSightsCallback(const FInputActionInstance& In
{ {
IsADS = true; IsADS = true;
UNakatomiCMC* cmc = GetCharacterMovementComponent(); if (UNakatomiCMC* cmc = GetCharacterMovementComponent())
if (cmc)
{ {
cmc->EnableAds(); cmc->EnableAds();
} }
@ -511,9 +505,7 @@ void APlayerCharacter::EndAimDownSightsCallback(const FInputActionInstance& Inst
{ {
IsADS = false; IsADS = false;
UNakatomiCMC* cmc = GetCharacterMovementComponent(); if (UNakatomiCMC* cmc = GetCharacterMovementComponent())
if (cmc)
{ {
cmc->DisableAds(); cmc->DisableAds();
} }
@ -548,9 +540,7 @@ void APlayerCharacter::PauseCallback(const FInputActionInstance& Instance)
void APlayerCharacter::BeginCrouchCallback(const FInputActionInstance& Instance) void APlayerCharacter::BeginCrouchCallback(const FInputActionInstance& Instance)
{ {
UNakatomiCMC* cmc = GetCharacterMovementComponent(); if (UNakatomiCMC* cmc = GetCharacterMovementComponent())
if (cmc)
{ {
cmc->EnableCrouch(); cmc->EnableCrouch();
} }
@ -558,9 +548,7 @@ void APlayerCharacter::BeginCrouchCallback(const FInputActionInstance& Instance)
void APlayerCharacter::EndCrouchCallback(const FInputActionInstance& Instance) void APlayerCharacter::EndCrouchCallback(const FInputActionInstance& Instance)
{ {
UNakatomiCMC* cmc = GetCharacterMovementComponent(); if (UNakatomiCMC* cmc = GetCharacterMovementComponent())
if (cmc)
{ {
cmc->DisableCrouch(); cmc->DisableCrouch();
} }
@ -568,9 +556,7 @@ void APlayerCharacter::EndCrouchCallback(const FInputActionInstance& Instance)
void APlayerCharacter::BeginSlideCallback(const FInputActionInstance& Instance) void APlayerCharacter::BeginSlideCallback(const FInputActionInstance& Instance)
{ {
UNakatomiCMC* cmc = GetCharacterMovementComponent(); if (UNakatomiCMC* cmc = GetCharacterMovementComponent())
if (cmc)
{ {
cmc->EnableSlide(); cmc->EnableSlide();
} }
@ -578,9 +564,7 @@ void APlayerCharacter::BeginSlideCallback(const FInputActionInstance& Instance)
void APlayerCharacter::EndSlideCallback(const FInputActionInstance& Instance) void APlayerCharacter::EndSlideCallback(const FInputActionInstance& Instance)
{ {
UNakatomiCMC* cmc = GetCharacterMovementComponent(); if (UNakatomiCMC* cmc = GetCharacterMovementComponent())
if (cmc)
{ {
cmc->DisableSlide(); cmc->DisableSlide();
} }