project-d-p / Client

0 stars 0 forks source link

Online 테스트 중 클라이언트가 잡은 몬스터를 반환할 때 생기는 에러 #51

Closed dkglee closed 1 month ago

dkglee commented 1 month ago

현재 상황 [이슈]

터지는 로그

Assertion failed: ScoreUI [File:C:\Users\idead\Documents\GitHub\Client\proj_a\Source\proj_a\Component\InGame\Score\Private\ClientScoreMananger.cpp] [Line: 22]

터지는 코드 장소

void UClientScoreMananger::InitScoreUi()
{
    ADPPlayerState* PS = GetWorld()->GetFirstPlayerController()->GetPlayerState<ADPPlayerState>();
    check(PS);
    TArray<TObjectPtr<APlayerState>> PlayerStates = Cast<ADPInGameState>(GetOwner())->PlayerArray;
    for (APlayerState* PlayerState : PlayerStates)
    {
        UTextBlock* TextBlock;
                // 여기서 터짐
        check(ScoreUI)
        if (Cast<ADPPlayerState>(PlayerState)->GetUniqueID() == PS->GetUniqueID())
        {
            Cast<ADPPlayerState>(PlayerState)->GetPlayerScoreComp()->PlayerScore_Text = ScoreUI->GetPlayerScoreTexts();
        }
        else
        {
            TextBlock = ScoreUI->FindEmptyTextBlock();
            check(TextBlock)
            Cast<ADPPlayerState>(PlayerState)->GetPlayerScoreComp()->PlayerScore_Text = TextBlock;
        }
    }
}

즉, nullptr 값이 들어서 터진다는 건데 게임이 꽤 지났음에도 초기화가 안된다는 것은 조금 이상함.