Bugfix Crash on Level Change if Player Still has Status Effects
This commit is contained in:
parent
b4b248b5e7
commit
e0e2286852
@ -52,6 +52,7 @@ void UStatusEffect::TickDown(AActor* Character)
|
|||||||
|
|
||||||
void UStatusEffect::CheckForExpiry(const float TimeOfExpiry, AActor* Character)
|
void UStatusEffect::CheckForExpiry(const float TimeOfExpiry, AActor* Character)
|
||||||
{
|
{
|
||||||
|
if (IsValid(Character)) return;
|
||||||
if (TimeOfExpiry <= UGameplayStatics::GetRealTimeSeconds(GetWorld())) OnExpiry(Character);
|
if (TimeOfExpiry <= UGameplayStatics::GetRealTimeSeconds(GetWorld())) OnExpiry(Character);
|
||||||
UStatusSystem* StatusSystem = Cast<UStatusSystem>(Character->GetComponentByClass(UStatusSystem::StaticClass()));
|
UStatusSystem* StatusSystem = Cast<UStatusSystem>(Character->GetComponentByClass(UStatusSystem::StaticClass()));
|
||||||
if (StatusSystem->GetActiveStatusEffect(this).StatusIcon == nullptr) return;
|
if (StatusSystem->GetActiveStatusEffect(this).StatusIcon == nullptr) return;
|
||||||
|
Loading…
Reference in New Issue
Block a user