From d9897b02fadc4e3aaa929102f150a73c6f76727e Mon Sep 17 00:00:00 2001 From: z411 Date: Tue, 1 Sep 2020 10:43:59 -0400 Subject: [PATCH] Added incremental timer after overtime --- qcsrc/client/hud/panel/timer.qc | 2 ++ qcsrc/common/stats.qh | 2 ++ qcsrc/server/world.qc | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/qcsrc/client/hud/panel/timer.qc b/qcsrc/client/hud/panel/timer.qc index 4a38d91d7..4fa3886b6 100644 --- a/qcsrc/client/hud/panel/timer.qc +++ b/qcsrc/client/hud/panel/timer.qc @@ -79,6 +79,8 @@ void HUD_Timer() } else { if (time < STAT(GAMESTARTTIME)) timer = seconds_tostring(floor(timelimit * 60)); + else if (overtimes > 0) + timer = seconds_tostring(floor(time - STAT(OVERTIMESTARTTIME))); else timer = seconds_tostring(timeleft); } diff --git a/qcsrc/common/stats.qh b/qcsrc/common/stats.qh index 2554bd1ef..2a614e427 100644 --- a/qcsrc/common/stats.qh +++ b/qcsrc/common/stats.qh @@ -66,6 +66,7 @@ float W_WeaponRateFactor(entity this); float game_stopped; float game_starttime; //point in time when the countdown to game start is over float round_starttime; //point in time when the countdown to round start is over +float overtime_starttime; // z411 point in time where first overtime started float checkrules_overtimesadded; // z411 add bool autocvar_g_allow_oldvortexbeam; int autocvar_leadlimit; @@ -106,6 +107,7 @@ REGISTER_STAT(SECRETS_TOTAL, int, secrets_total) REGISTER_STAT(SECRETS_FOUND, int, secrets_found) REGISTER_STAT(RESPAWN_TIME, float) REGISTER_STAT(ROUNDSTARTTIME, float, round_starttime) +REGISTER_STAT(OVERTIMESTARTTIME, float, overtime_starttime) REGISTER_STAT(OVERTIMESADDED, float, checkrules_overtimesadded) REGISTER_STAT(MONSTERS_TOTAL, int) REGISTER_STAT(MONSTERS_KILLED, int) diff --git a/qcsrc/server/world.qc b/qcsrc/server/world.qc index 5b27094ea..82ec1f3ac 100644 --- a/qcsrc/server/world.qc +++ b/qcsrc/server/world.qc @@ -1666,8 +1666,10 @@ void InitiateOvertime() // ONLY call this if InitiateSuddenDeath returned true Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_OVERTIME_TIME, autocvar_timelimit_overtime * 60); sound(NULL, CH_INFO, SND_OVERTIME, VOL_BASE, ATTN_NONE); - if(checkrules_overtimesadded == 1) + if(checkrules_overtimesadded == 1) { Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_OVERTIME); + overtime_starttime = time; + } } float GetWinningCode(float fraglimitreached, float equality) -- 2.39.2