]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fixed round countdown while on timeout
authorz411 <z411@omaera.org>
Fri, 2 Apr 2021 22:01:10 +0000 (19:01 -0300)
committerz411 <z411@omaera.org>
Fri, 2 Apr 2021 22:01:10 +0000 (19:01 -0300)
qcsrc/client/announcer.qc

index 28b5c1b1f32b40ed4d9bc842e27bb1291bb24b80..e5c18a559b243ec3ce99d342db2d4f64210991e0 100644 (file)
@@ -26,19 +26,19 @@ void Announcer_Countdown(entity this)
 {
        float starttime = STAT(GAMESTARTTIME);
        float roundstarttime = STAT(ROUNDSTARTTIME);
+       float game_timeout = STAT(GAME_TIMEOUT);
        
        bool rounds;
        float countdown;
        
-       // z411 LOG_INFOF("time: %d - starttime: %d - roundstarttime: %d", time, starttime, roundstarttime);
-       
-       if(roundstarttime == -1)
+       if(roundstarttime == -1 || game_timeout)
        {
                Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_ROUNDSTOP);
                delete(this);
                announcer_countdown = NULL;
                return;
        }
+
        //if(roundstarttime >= starttime)
        //      starttime = roundstarttime;
        if(starttime <= time && roundstarttime != starttime) // game start time has passed
@@ -70,12 +70,10 @@ void Announcer_Countdown(entity this)
                // counting down to rounds
                if(rounds)
                {
-                       if (timeout_status != TIMEOUT_ACTIVE) {
-                               Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_ROUNDSTART, countdown_rounded);
-                               Notification annce_num = Announcer_PickNumber(CNT_ROUNDSTART, countdown_rounded);
-                               if(annce_num != NULL)
-                                       Local_Notification(MSG_ANNCE, annce_num);
-                       }
+                       Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_ROUNDSTART, countdown_rounded);
+                       Notification annce_num = Announcer_PickNumber(CNT_ROUNDSTART, countdown_rounded);
+                       if(annce_num != NULL)
+                               Local_Notification(MSG_ANNCE, annce_num);
                        this.nextthink = (roundstarttime - (countdown - 1));
                }
                else
@@ -129,8 +127,6 @@ void Announcer_Gamestart()
 
                        // z411 set title
                        if(time < STAT(GAMESTARTTIME) && !warmup_stage) {
-                               //if(IS_GAMETYPE(DUEL)) {
-                               //if(g_duel) {
                                if(gametype == MAPINFO_TYPE_DUEL) {
                                        entity pl1 = players.sort_next;
                                        entity pl2 = pl1.sort_next;