Fix to CountdownTimer

This commit is contained in:
Kingsmedia 2022-05-11 11:06:00 +02:00
parent 3e842336d0
commit fc9bbec5d2
3 changed files with 14 additions and 0 deletions

View File

@ -22,6 +22,10 @@
"Editor" "Editor"
] ]
}, },
{
"Name": "OnlineSubsystemSteam",
"Enabled": true
},
{ {
"Name": "Bridge", "Name": "Bridge",
"Enabled": true, "Enabled": true,

Binary file not shown.

View File

@ -225,6 +225,16 @@ void ABlasterPlayerController::SetHUDTime()
else if (MatchState == MatchState::Cooldown) TimeLeft = CooldownTime + WarmupTime + MatchTime - GetServerTime() + LevelStartingTime; else if (MatchState == MatchState::Cooldown) TimeLeft = CooldownTime + WarmupTime + MatchTime - GetServerTime() + LevelStartingTime;
uint32 SecondsLeft = FMath::CeilToInt(TimeLeft); uint32 SecondsLeft = FMath::CeilToInt(TimeLeft);
if (HasAuthority())
{
BlasterGameMode = BlasterGameMode == nullptr ? Cast<ABlasterGameMode>(UGameplayStatics::GetGameMode(this)) : BlasterGameMode;
if (BlasterGameMode)
{
SecondsLeft = FMath::CeilToInt(BlasterGameMode->GetCountdownTime() + LevelStartingTime);
}
}
if (CountdownInt != SecondsLeft) if (CountdownInt != SecondsLeft)
{ {
if (MatchState == MatchState::WaitingToStart || MatchState == MatchState::Cooldown) if (MatchState == MatchState::WaitingToStart || MatchState == MatchState::Cooldown)