We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3f7c30e commit bfb5c4eCopy full SHA for bfb5c4e
Source/Bomber/Private/GameFramework/MyPlayerState.cpp
@@ -110,10 +110,10 @@ void AMyPlayerState::OnRep_EndGameState()
110
// Applies currently changed End-Game state for this player
111
void AMyPlayerState::ApplyEndGameState()
112
{
113
- AMyPlayerController* MyPC = IsPlayerStateLocallyControlled() ? Cast<AMyPlayerController>(GetPlayerController()) : nullptr;
114
- if (MyPC)
+ if (HasAuthority()
+ && UMyBlueprintFunctionLibrary::GetAlivePlayersNum() <= 1)
115
116
- MyPC->SetEndGameState();
+ AMyGameStateBase::Get().SetGameState(ECGS::EndGame);
117
}
118
119
if (OnEndGameStateChanged.IsBound())
0 commit comments