Skip to content

Commit

Permalink
Hopefully fix the round timer announcing one second too late
Browse files Browse the repository at this point in the history
  • Loading branch information
Simyon264 committed Oct 19, 2024
1 parent 8a0ccbd commit 289b250
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,19 +227,19 @@ private void UpdateTimer(ref SuspicionRuleComponent sus, float frameTime)
var timeLeft = sus.EndAt.TotalSeconds;
switch (timeLeft)
{
case <= 240 when !sus.AnnouncedTimeLeft.Contains(240):
case <= 241 when !sus.AnnouncedTimeLeft.Contains(241):
_chatManager.DispatchServerAnnouncement($"The round will end in {Math.Round(sus.EndAt.TotalMinutes)}:{sus.EndAt.Seconds}.");
sus.AnnouncedTimeLeft.Add(240);
break;
case <= 180 when !sus.AnnouncedTimeLeft.Contains(180):
case <= 181 when !sus.AnnouncedTimeLeft.Contains(181):
_chatManager.DispatchServerAnnouncement($"The round will end in {Math.Round(sus.EndAt.TotalMinutes)}:{sus.EndAt.Seconds}.");
sus.AnnouncedTimeLeft.Add(180);
break;
case <= 120 when !sus.AnnouncedTimeLeft.Contains(120):
case <= 121 when !sus.AnnouncedTimeLeft.Contains(121):
_chatManager.DispatchServerAnnouncement($"The round will end in {Math.Round(sus.EndAt.TotalMinutes)}:{sus.EndAt.Seconds}.");
sus.AnnouncedTimeLeft.Add(120);
break;
case <= 60 when !sus.AnnouncedTimeLeft.Contains(60):
case <= 61 when !sus.AnnouncedTimeLeft.Contains(61):
_chatManager.DispatchServerAnnouncement($"The round will end in {Math.Round(sus.EndAt.TotalMinutes)}:{sus.EndAt.Seconds}.");
sus.AnnouncedTimeLeft.Add(60);
break;
Expand Down

0 comments on commit 289b250

Please sign in to comment.