From: z411 Date: Tue, 1 Mar 2022 13:06:30 +0000 (-0300) Subject: Fixed typo and standardized function names X-Git-Tag: xonotic-v0.8.5~177^2~5 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=247cce6ee624446e40905f979e2ebcd0f9f56bb1;p=xonotic%2Fxonotic-data.pk3dir.git Fixed typo and standardized function names --- 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);