From 247cce6ee624446e40905f979e2ebcd0f9f56bb1 Mon Sep 17 00:00:00 2001 From: z411 Date: Tue, 1 Mar 2022 10:06:30 -0300 Subject: [PATCH] Fixed typo and standardized function names --- qcsrc/client/hud/panel/timer.qc | 10 +++++----- qcsrc/client/hud/panel/timer.qh | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/qcsrc/client/hud/panel/timer.qc b/qcsrc/client/hud/panel/timer.qc index 407f8d53a..872e74fd5 100644 --- a/qcsrc/client/hud/panel/timer.qc +++ b/qcsrc/client/hud/panel/timer.qc @@ -20,12 +20,12 @@ vector HUD_Timer_Color(float timeleft) return '1 0 0'; //red } -float HUD_Timer_Elapsed(float curtime, float starttime) +float HUD_Timer_TimeElapsed(float curtime, float starttime) { - float time_elapsed = floor(curtime - STAT(GAMESTARTTIME)); + float time_elapsed = curtime - starttime; if (!autocvar_hud_panel_timer_unbound) time_elapsed = max(0, time_elapsed); - return time_elapsed; + return floor(time_elapsed); } float HUD_Timer_TimeLeft(float curtime, float starttime, float timelimit) @@ -92,7 +92,7 @@ void HUD_Timer() // Timer text if (autocvar_hud_panel_timer_increment || timelimit == 0) - timer = seconds_tostring(HUD_Timer_Elapsed(curtime, STAT(GAMESTARTTIME))); + timer = seconds_tostring(HUD_Timer_TimeElapsed(curtime, STAT(GAMESTARTTIME))); else timer = seconds_tostring(timeleft); @@ -119,7 +119,7 @@ void HUD_Timer() // Subtimer text if (autocvar_hud_panel_timer_increment || round_timelimit <= 0) - subtimer = seconds_tostring(HUD_Timer_Elapsed(round_curtime, STAT(ROUNDSTARTTIME))); + subtimer = seconds_tostring(HUD_Timer_TimeElapsed(round_curtime, STAT(ROUNDSTARTTIME))); else subtimer = seconds_tostring(round_timeleft); } diff --git a/qcsrc/client/hud/panel/timer.qh b/qcsrc/client/hud/panel/timer.qh index b80c3e4ed..3790f4777 100644 --- a/qcsrc/client/hud/panel/timer.qh +++ b/qcsrc/client/hud/panel/timer.qh @@ -8,5 +8,5 @@ int autocvar_hud_panel_timer_secondary = 1; bool autocvar_hud_panel_timer_unbound; vector HUD_Timer_Color(float timeleft); -float HUD_Timer_Elapsed(float curtime, float starttime); +float HUD_Timer_TimeElapsed(float curtime, float starttime); float HUD_Timer_TimeLeft(float curtime, float starttime, float timelimit); -- 2.39.2