X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fannouncer.qc;h=51c67ccabe53d9a0d25eef6cc8a41f2317bd5a0a;hb=3aed354c1125db3e6e862f552c253b06b09d5d86;hp=240d424c6a5ee255eb4eb8135ff4e7137733a0c1;hpb=c62a8010ce4cfc8ef8b107be5544ba58335b8967;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/announcer.qc b/qcsrc/client/announcer.qc index 240d424c6..51c67ccab 100644 --- a/qcsrc/client/announcer.qc +++ b/qcsrc/client/announcer.qc @@ -22,22 +22,35 @@ void Announcer_Play(string announcement) void Announcer_Countdown() { float starttime = getstatf(STAT_GAMESTARTTIME); + float roundstarttime = getstatf(STAT_ROUNDSTARTTIME); + if(roundstarttime == -1) + { + // stop countdown immediately + centerprint_generic(CPID_GAME_STARTING, "", 1, 0); + remove(self); + return; + } + if(roundstarttime >= starttime) + starttime = roundstarttime; + if(starttime <= time && roundstarttime != starttime) // game start time has passed + announcer_5min = announcer_1min = FALSE; // reset maptime announcers now as well + float countdown = (starttime - time); float countdown_rounded = floor(0.5 + countdown); - + if(countdown <= 0) // countdown has finished, starttime is now { - if (!spectatee_status) - Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_BEGIN); + Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_BEGIN); Announcer_Play("begin"); - announcer_5min = announcer_1min = FALSE; // reset maptime announcers now as well remove(self); return; } else // countdown is still going { - if (!spectatee_status) + if(roundstarttime == starttime) + centerprint_generic(CPID_GAME_STARTING, _("^1Round starts in %d seconds"), 1, countdown_rounded); + else Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_GAMESTART, countdown_rounded); if(countdown_rounded <= 3 && countdown_rounded >= 1) @@ -57,12 +70,15 @@ void Announcer_Countdown() void Announcer_Gamestart() { float startTime = getstatf(STAT_GAMESTARTTIME); - + float roundstarttime = getstatf(STAT_ROUNDSTARTTIME); + if(roundstarttime > startTime) + startTime = roundstarttime; + if(previous_game_starttime != startTime) { if((time + 5.0) < startTime) // if connecting to server while restart was active don't always play prepareforbattle Announcer_Play("prepareforbattle"); - + if(time < startTime) { entity e;