Hotfix round restart loops (#16292)

Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>
This commit is contained in:
metalgearsloth
2023-05-11 11:00:39 +10:00
committed by GitHub
parent 90d13d79ac
commit 20748cc542
3 changed files with 22 additions and 3 deletions

View File

@@ -201,7 +201,12 @@ public sealed class PlayTimeTrackingSystem : EntitySystem
return;
var player = _playerManager.GetSessionByUserId(userId);
var playTimes = _tracking.GetTrackerTimes(player);
if (!_tracking.TryGetTrackerTimes(player, out var playTimes))
{
// Sorry mate but your playtimes haven't loaded.
Logger.ErrorS("playtime", $"Playtimes weren't ready yet for {player} on roundstart!");
playTimes ??= new Dictionary<string, TimeSpan>();
}
for (var i = 0; i < jobs.Count; i++)
{