X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fannouncer.qc;h=109d014374bff33184d39b5a4deafb855ea757e6;hb=322fd059ab536367167b2af916657715a886a068;hp=9da998ae679f65c6819a9141f2388cec8735d33b;hpb=2b728b9c59ef61318b7ca5a261cb7fa45d2143aa;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/announcer.qc b/qcsrc/client/announcer.qc index 9da998ae6..109d01437 100644 --- a/qcsrc/client/announcer.qc +++ b/qcsrc/client/announcer.qc @@ -15,15 +15,18 @@ string AnnouncerOption() return ret; } +entity announcer_countdown; + void Announcer_Countdown() { SELFPARAM(); - float starttime = getstatf(STAT_GAMESTARTTIME); - float roundstarttime = getstatf(STAT_ROUNDSTARTTIME); + float starttime = STAT(GAMESTARTTIME); + float roundstarttime = STAT(ROUNDSTARTTIME); if(roundstarttime == -1) { Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_ROUNDSTOP); remove(this); + announcer_countdown = NULL; return; } if(roundstarttime >= starttime) @@ -39,6 +42,7 @@ void Announcer_Countdown() Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_BEGIN); Local_Notification(MSG_MULTI, MULTI_COUNTDOWN_BEGIN); remove(this); + announcer_countdown = NULL; return; } else // countdown is still going @@ -69,8 +73,8 @@ void Announcer_Countdown() float previous_game_starttime; void Announcer_Gamestart() { - float startTime = getstatf(STAT_GAMESTARTTIME); - float roundstarttime = getstatf(STAT_ROUNDSTARTTIME); + float startTime = STAT(GAMESTARTTIME); + float roundstarttime = STAT(ROUNDSTARTTIME); if(roundstarttime > startTime) startTime = roundstarttime; @@ -78,7 +82,6 @@ void Announcer_Gamestart() { if(time < startTime) { - static entity announcer_countdown; if (!announcer_countdown) { announcer_countdown = new(announcer_countdown); @@ -100,13 +103,13 @@ void Announcer_Gamestart() // Plays the 1 minute or 5 minutes (of maptime) remaining sound, if client wants it void Announcer_Time() { - float timelimit = getstatf(STAT_TIMELIMIT); - float timeleft = max(0, timelimit * 60 + getstatf(STAT_GAMESTARTTIME) - time); + float timelimit = STAT(TIMELIMIT); + float timeleft = max(0, timelimit * 60 + STAT(GAMESTARTTIME) - time); float warmup_timeleft = 0; if(warmup_stage) if(autocvar_g_warmup_limit > 0) - warmup_timeleft = max(0, autocvar_g_warmup_limit + getstatf(STAT_GAMESTARTTIME) - time); + warmup_timeleft = max(0, autocvar_g_warmup_limit + STAT(GAMESTARTTIME) - time); // 5 minute check if(autocvar_cl_announcer_maptime >= 2)