void AKillEmAllGameMode::EndGame(bool bIsPlayerWinner)
{
for (AController* Controller : TActorRange<AController>(GetWorld()))
{
bool bIsWinner = Controller->IsPlayerController() == bIsPlayerWinner;
Controller->GameHasEnded(Controller->GetPawn(), bIsWinner);
}
}
I have a question about the EndGame here. It is mentioned that we need to notify all the controllers that the game is ended instead of just telling the player controller. I wonder why we need to also call GameHasEnded of the AI controller? It seems we are not doing anything to the AI controllers when the game ended.