Skip to content

Commit

Permalink
Cleanup Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
x33-byte committed Nov 14, 2023
1 parent fae1aa0 commit 3c495f6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
3 changes: 0 additions & 3 deletions Source/ALS/Private/AlsCharacter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1076,9 +1076,6 @@ void AAlsCharacter::SetOverlayMode(const FGameplayTag& NewOverlayMode, const boo
else
{
ServerSetOverlayMode(OverlayMode);
} else if (GetLocalRole() == ROLE_Authority)
{
ClientSetOverlayMode(OverlayMode);
}
}
}
Expand Down
19 changes: 11 additions & 8 deletions Source/ALS/Private/AlsCharacter_Actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "Engine/NetConnection.h"
#include "Engine/SkeletalMesh.h"
#include "Net/Core/PushModel/PushModel.h"
#include "Player/LyraPlayerController.h"
#include "RootMotionSources/AlsRootMotionSource_Mantling.h"
#include "Settings/AlsCharacterSettings.h"
#include "Utility/AlsConstants.h"
Expand Down Expand Up @@ -104,7 +105,7 @@ void AAlsCharacter::StartRollingImplementation(UAnimMontage* Montage, const floa
{
RollingState.TargetYawAngle = TargetYawAngle;

RefreshRotationInstant(StartYawAngle);
RefreshRotationInstant(InitialYawAngle);
}
}
}
Expand Down Expand Up @@ -971,7 +972,7 @@ void AAlsCharacter::LimitRagdollSpeed() const

bool AAlsCharacter::IsRagdollingAllowedToStop() const
{
return LocomotionAction == AlsLocomotionActionTags::Ragdolling && RagdollingState.bGrounded;
return LocomotionAction == AlsLocomotionActionTags::Ragdolling && RagdollingState.Grounded;
}

bool AAlsCharacter::StopRagdolling()
Expand Down Expand Up @@ -1031,9 +1032,8 @@ void AAlsCharacter::StopRagdollingImplementation()

GetCharacterMovement()->NetworkSmoothingMode = ENetworkSmoothingMode::Exponential;
GetCharacterMovement()->bIgnoreClientMovementErrorChecksAndCorrection = false;

bool bGrounded;
const auto NewActorLocation{RagdollTraceGround(bGrounded)};

const auto NewActorLocation{RagdollTraceGround(RagdollingState.Grounded)};

// Determine whether the ragdoll is facing upward or downward and set the actor rotation accordingly.

Expand Down Expand Up @@ -1085,7 +1085,7 @@ void AAlsCharacter::StopRagdollingImplementation()

AlsCharacterMovement->SetMovementModeLocked(false);

if (bGrounded)
if (RagdollingState.Grounded)
{
GetCharacterMovement()->SetMovementMode(MOVE_Walking);
}
Expand All @@ -1099,7 +1099,7 @@ void AAlsCharacter::StopRagdollingImplementation()

OnRagdollEnded.Broadcast();

if (bGrounded &&
if (RagdollingState.Grounded &&
GetMesh()->GetAnimInstance()->Montage_Play(SelectGetUpMontage(bRagdollFacingUpward), 1.0f,
EMontagePlayReturnType::MontageLength, 0.0f, true))
{
Expand All @@ -1108,14 +1108,17 @@ void AAlsCharacter::StopRagdollingImplementation()
SetLocomotionAction(AlsLocomotionActionTags::GettingUp);

// Re-equip active slot - casting hell...
if (APlayerController* PlayerController = Cast<APlayerController>(GetController()))
// TODO: Fix with Activate Ability
// @Game-Change - Start
if (const ALyraPlayerController* PlayerController = Cast<ALyraPlayerController>(GetController()))
{
UActorComponent* FoundComponent = PlayerController->FindComponentByClass(ULyraQuickBarComponent::StaticClass());
if (ULyraQuickBarComponent* QuickBar = Cast<ULyraQuickBarComponent>(FoundComponent))
{
QuickBar->SetLastActiveSlot();
}
}
// @Game-Change - End
}
}

Expand Down
4 changes: 2 additions & 2 deletions Source/ALS/Public/AlsCharacter.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class ALS_API AAlsCharacter : public ALyraCharacter
protected:
void SetLocomotionMode(const FGameplayTag& NewLocomotionMode);

virtual void NotifyLocomotionModeChanged(const FGameplayTag& PreviousLocomotionMode);
virtual void NotifyLocomotionModeChanged(const FGameplayTag& NewLocomotionMode, const FGameplayTag& PreviousLocomotionMode);

UFUNCTION(BlueprintNativeEvent, Category = "Als Character")
void OnLocomotionModeChanged(const FGameplayTag& NewLocomotionMode, const FGameplayTag& PreviousLocomotionMode);
Expand Down Expand Up @@ -354,7 +354,7 @@ class ALS_API AAlsCharacter : public ALyraCharacter
void SetLocomotionAction(const FGameplayTag& NewLocomotionAction);

protected:
virtual void NotifyLocomotionActionChanged(const FGameplayTag& PreviousLocomotionAction);
virtual void NotifyLocomotionActionChanged(const FGameplayTag& NewLocomotionAction, const FGameplayTag& PreviousLocomotionAction);

UFUNCTION(BlueprintNativeEvent, Category = "Als Character")
void OnLocomotionActionChanged(const FGameplayTag& NewLocomotionAction, const FGameplayTag& PreviousLocomotionAction);
Expand Down
3 changes: 3 additions & 0 deletions Source/ALS/Public/State/AlsRagdollingState.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ struct ALS_API FAlsRagdollingState
{
GENERATED_BODY()

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ALS")
bool Grounded;

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "ALS")
FVector Velocity{ForceInit};

Expand Down

0 comments on commit 3c495f6

Please sign in to comment.