diff --git a/Source/StudyFrameworkPlugin/Private/SFGameInstance.cpp b/Source/StudyFrameworkPlugin/Private/SFGameInstance.cpp index 6110a10197ad8bad5700f77ed31c0cb16e3ff0a9..cd15145a398f025fdb35145b156a8e327df53314 100644 --- a/Source/StudyFrameworkPlugin/Private/SFGameInstance.cpp +++ b/Source/StudyFrameworkPlugin/Private/SFGameInstance.cpp @@ -783,13 +783,14 @@ void USFGameInstance::OnLevelLoaded() void USFGameInstance::OnFadedIn() { - FString NumberStr = FString::FromInt(GetCurrentConditionsSequenceNumber()) + "/" + FString::FromInt(Participant->GetAllConditions().Num()); + if (Participant && Participant->GetCurrentCondition()) { //this should be logged first if (bInDebugMode) { USFLoggingBPLibrary::LogComment("Running in DEBUG MODE"); } + FString NumberStr = FString::FromInt(GetCurrentConditionsSequenceNumber()) + "/" + FString::FromInt(Participant->GetAllConditions().Num()); USFLoggingBPLibrary::LogComment("Start Condition " + NumberStr + ": " + Participant->GetCurrentCondition()->GetPrettyName()); } @@ -802,7 +803,7 @@ void USFGameInstance::OnFadedIn() Participant->GetCurrentCondition()->Begin(); - UpdateHUD("Condition " + NumberStr); + UpdateHUD("Condition " + FString::FromInt(GetCurrentConditionsSequenceNumber()) + "/" + FString::FromInt(Participant->GetAllConditions().Num())); } USFParticipant* USFGameInstance::GetParticipant() const