From e0e22868521e1518ea32c292cfe679d8b18b3a82 Mon Sep 17 00:00:00 2001 From: PHILIP White Date: Sun, 21 May 2023 17:40:54 +0100 Subject: [PATCH] Bugfix Crash on Level Change if Player Still has Status Effects --- Source/the_twilight_abyss/TurnBasedCombatV2/StatusEffect.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/the_twilight_abyss/TurnBasedCombatV2/StatusEffect.cpp b/Source/the_twilight_abyss/TurnBasedCombatV2/StatusEffect.cpp index b11966f..6f180ea 100644 --- a/Source/the_twilight_abyss/TurnBasedCombatV2/StatusEffect.cpp +++ b/Source/the_twilight_abyss/TurnBasedCombatV2/StatusEffect.cpp @@ -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(Character->GetComponentByClass(UStatusSystem::StaticClass())); if (StatusSystem->GetActiveStatusEffect(this).StatusIcon == nullptr) return;