Bugfix Crash on Level Change if Player Still has Status Effects

This commit is contained in:
Philip W 2023-05-21 17:40:54 +01:00
parent b4b248b5e7
commit e0e2286852

View File

@ -52,6 +52,7 @@ void UStatusEffect::TickDown(AActor* Character)
void UStatusEffect::CheckForExpiry(const float TimeOfExpiry, AActor* Character)
{
if (IsValid(Character)) return;
if (TimeOfExpiry <= UGameplayStatics::GetRealTimeSeconds(GetWorld())) OnExpiry(Character);
UStatusSystem* StatusSystem = Cast<UStatusSystem>(Character->GetComponentByClass(UStatusSystem::StaticClass()));
if (StatusSystem->GetActiveStatusEffect(this).StatusIcon == nullptr) return;