]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fixed typo and standardized function names
authorz411 <z411@omaera.org>
Tue, 1 Mar 2022 13:06:30 +0000 (10:06 -0300)
committerz411 <z411@omaera.org>
Tue, 1 Mar 2022 13:06:30 +0000 (10:06 -0300)
qcsrc/client/hud/panel/timer.qc
qcsrc/client/hud/panel/timer.qh

index 407f8d53a1a5fe9b8f304a3a0ed178ccd1498060..872e74fd5d954c34fab0a7069b26f7a0848fd27a 100644 (file)
@@ -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);
                }
index b80c3e4ed6ca90149ddc511ca30c292e4bd31228..3790f477708accf11c062186355477a102761359 100644 (file)
@@ -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);