From 27edda49daec10f39b25f5362616e342c6592c9d Mon Sep 17 00:00:00 2001 From: z411 Date: Wed, 5 Jan 2022 23:31:59 -0300 Subject: [PATCH] Fix round handler --- qcsrc/client/announcer.qc | 4 ++-- qcsrc/server/command/vote.qc | 1 + qcsrc/server/round_handler.qc | 7 ++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/qcsrc/client/announcer.qc b/qcsrc/client/announcer.qc index 44267a92f..9f4593230 100644 --- a/qcsrc/client/announcer.qc +++ b/qcsrc/client/announcer.qc @@ -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 } } diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc index 4b9429842..466d85f72 100644 --- a/qcsrc/server/command/vote.qc +++ b/qcsrc/server/command/vote.qc @@ -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"); } diff --git a/qcsrc/server/round_handler.qc b/qcsrc/server/round_handler.qc index b30242813..d744bd042 100644 --- a/qcsrc/server/round_handler.qc +++ b/qcsrc/server/round_handler.qc @@ -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; } } } -- 2.39.2