Skip to content

Commit

Permalink
Possible fix for rare mantling crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
dyanikoglu committed Apr 8, 2021
1 parent e1773bb commit 9e16135
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Source/ALSV4_CPP/Private/Components/ALSMantleComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void UALSMantleComponent::TickComponent(float DeltaTime, ELevelTick TickType,
void UALSMantleComponent::MantleStart(float MantleHeight, const FALSComponentAndTransform& MantleLedgeWS,
EALSMantleType MantleType)
{
if (OwnerCharacter == nullptr || MantleLedgeWS.Component == nullptr || MantleTimeline == nullptr)
if (OwnerCharacter == nullptr || !IsValid(MantleLedgeWS.Component) || !IsValid(MantleTimeline))
{
return;
}
Expand All @@ -85,7 +85,8 @@ void UALSMantleComponent::MantleStart(float MantleHeight, const FALSComponentAnd
SetComponentTickEnabledAsync(false);

// Step 1: Get the Mantle Asset and use it to set the new Mantle Params.
const FALSMantleAsset& MantleAsset = GetMantleAsset(MantleType, OwnerCharacter->GetOverlayState());
const FALSMantleAsset MantleAsset = GetMantleAsset(MantleType, OwnerCharacter->GetOverlayState());
check(MantleAsset.PositionCorrectionCurve)

MantleParams.AnimMontage = MantleAsset.AnimMontage;
MantleParams.PositionCorrectionCurve = MantleAsset.PositionCorrectionCurve;
Expand Down

0 comments on commit 9e16135

Please sign in to comment.