]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix round handler
authorz411 <z411@omaera.org>
Thu, 6 Jan 2022 02:31:59 +0000 (23:31 -0300)
committerz411 <z411@omaera.org>
Thu, 6 Jan 2022 02:31:59 +0000 (23:31 -0300)
qcsrc/client/announcer.qc
qcsrc/server/command/vote.qc
qcsrc/server/round_handler.qc

index 44267a92f1ab5e718f6533b5085606915ef1f304..9f459323045bd2f4f822671235bc104d8920c4db 100644 (file)
@@ -113,7 +113,7 @@ void Announcer_Gamestart()
                        }
 
                        // z411 set title
-                       if(time < STAT(GAMESTARTTIME) && !warmup_stage) {
+                       if(time <= STAT(GAMESTARTTIME) && !warmup_stage) {
                                if(gametype == MAPINFO_TYPE_DUEL) {
                                        entity pl1 = players.sort_next;
                                        entity pl2 = pl1.sort_next;
@@ -132,7 +132,7 @@ void Announcer_Gamestart()
                                        Local_Notification(MSG_ANNCE, ANNCE_PREPARE);
                        }
                        
-                       announcer_countdown.nextthink = startTime - floor(startTime - time); //synchronize nextthink to startTime
+                       announcer_countdown.nextthink = startTime - floor(startTime - time + 0.5); //synchronize nextthink to startTime
                }
        }
 
index 4b9429842914b50db70f945c435ca70d73a56289..466d85f722da0a5b27ceaf1c1644ec29ea2fca78 100644 (file)
@@ -486,6 +486,7 @@ void ReadyRestart_force(bool is_fake_round_start)
                FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), { CS(it).allowed_timeouts = autocvar_sv_timeout_number; });
        }
 
+       round_handler_Activate(!warmup_stage);
        if (!sv_ready_restart_after_countdown || warmup_stage) reset_map(true, is_fake_round_start);
        if (autocvar_sv_eventlog) GameLogEcho(":restart");
 }
index b30242813cec42c098eca227ebb422519eed7ad9..d744bd04288728d87b11c7ebdc2d79623ea7cacb 100644 (file)
@@ -8,8 +8,9 @@
 
 void round_handler_Think(entity this)
 {
+       if (!this.isactive) return;
        if (game_timeout) { this.nextthink = time + 1; return; }
-       
+
        if (intermission_running)
        {
                round_handler_Reset(0);
@@ -97,14 +98,12 @@ void round_handler_Spawn(bool() canRoundStart_func, bool() canRoundEnd_func, voi
                return;
        }
        entity this = round_handler = new_pure(round_handler);
-
        
        this.canRoundStart = canRoundStart_func;
        this.canRoundEnd = canRoundEnd_func;
        this.roundStart = roundStart_func;
        this.wait = false;
        round_handler_Init(5, 5, 180);
-       
 }
 
 void round_handler_Activate(bool active) {
@@ -115,6 +114,8 @@ void round_handler_Activate(bool active) {
                if(active) {
                        setthink(this, round_handler_FirstThink);
                        this.nextthink = time;
+               } else {
+                       round_starttime = -1;
                }
        }
 }