Skip to content

Commit 4fa92ed

Browse files
committed
[Bug] Fixed End-Game Menu does not display match result if widget was already opened of match timer expired
1 parent b8071e1 commit 4fa92ed

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Source/Bomber/Private/GameFramework/MyPlayerState.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ void AMyPlayerState::OnGameStateChanged(ECurrentGameState CurrentGameState)
8383
case ECurrentGameState::GameStarting:
8484
{
8585
EndGameStateInternal = EEndGameState::None;
86+
OnEndGameStateChanged.Broadcast(EndGameStateInternal);
8687
break;
8788
}
8889
case ECurrentGameState::EndGame:
@@ -109,6 +110,7 @@ void AMyPlayerState::ServerUpdateEndState_Implementation()
109110
if (CurrentGameState == ECurrentGameState::EndGame) // game was finished
110111
{
111112
EndGameStateInternal = EEndGameState::Draw;
113+
OnEndGameStateChanged.Broadcast(EndGameStateInternal);
112114
return;
113115
}
114116

Source/Bomber/Private/UI/InGameMenuWidget.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ void UInGameMenuWidget::OnGameStateChanged(ECurrentGameState CurrentGameState)
104104
// Called when the end-game state was changed
105105
void UInGameMenuWidget::OnEndGameStateChanged(EEndGameState EndGameState)
106106
{
107+
UpdateEndGameText();
108+
107109
if (EndGameState != EEndGameState::None)
108110
{
109111
ShowInGameMenu();
@@ -201,8 +203,6 @@ void UInGameMenuWidget::ShowInGameMenu()
201203
return;
202204
}
203205

204-
UpdateEndGameText();
205-
206206
OnToggleInGameMenu(true);
207207

208208
// Blueprint implementation

0 commit comments

Comments
 (0)