From: terencehill Date: Tue, 8 Mar 2022 20:48:12 +0000 (+0100) Subject: Fix double "5 minutes remaining" announcement if timelimit is <= 5 on map start and... X-Git-Tag: xonotic-v0.8.5~166 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=60147861454ed8dabfb033e42b0b170ba3f04d55;p=xonotic%2Fxonotic-data.pk3dir.git Fix double "5 minutes remaining" announcement if timelimit is <= 5 on map start and fix missing announcements after a resetmatch if warmup is enabled --- diff --git a/qcsrc/client/announcer.qc b/qcsrc/client/announcer.qc index 5baaddeff..1bbf90037 100644 --- a/qcsrc/client/announcer.qc +++ b/qcsrc/client/announcer.qc @@ -28,8 +28,6 @@ void Announcer_Countdown(entity this) announcer_countdown = NULL; return; } - if(starttime <= time && roundstarttime != starttime) // game start time has passed - announcer_5min = announcer_1min = false; // reset maptime announcers now as well bool inround = (roundstarttime && time >= starttime); float countdown = (inround ? roundstarttime - time : starttime - time); @@ -127,9 +125,25 @@ MACRO_END void Announcer_Time() { + static bool warmup_stage_prev; + if(intermission) return; + if (warmup_stage != warmup_stage_prev) + { + announcer_5min = announcer_1min = false; + warmup_stage_prev = warmup_stage; + return; + } + + float starttime = STAT(GAMESTARTTIME); + if(time < starttime) + { + announcer_5min = announcer_1min = false; + return; + } + float timeleft; if(warmup_stage) { @@ -140,7 +154,7 @@ void Announcer_Time() timeleft = 0; } else - timeleft = max(0, STAT(TIMELIMIT) * 60 + STAT(GAMESTARTTIME) - time); + timeleft = max(0, STAT(TIMELIMIT) * 60 + starttime - time); if(autocvar_cl_announcer_maptime >= 2) ANNOUNCER_CHECKMINUTE(5);