Skip to content

Commit

Permalink
Use duration floater
Browse files Browse the repository at this point in the history
Co-Authored-By: Ivan Molodetskikh <[email protected]>
  • Loading branch information
sabianroberts and YaLTeR committed Nov 11, 2024
1 parent 044ddaa commit 8b60bce
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions cl_dll/hud_watermark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "update_checker.h"

extern cvar_t* hud_watermark;
float duration = 15.0f;

int CHudWatermark::Init()
{
Expand All @@ -24,20 +25,12 @@ int CHudWatermark::VidInit()

int CHudWatermark::Draw(float time)
{
if (hud_watermark->value != 0)
{
if (hud_watermark->value != 1)
duration = 5.0f;

if (refresh_draw_until || (draw_until > gHUD.m_flTime + 15.0f)) {
refresh_draw_until = false;
draw_until = gHUD.m_flTime + 15.0f;
}
}
else
{
if (refresh_draw_until || (draw_until > gHUD.m_flTime + 5.0f)) {
refresh_draw_until = false;
draw_until = gHUD.m_flTime + 5.0f;
}
if (refresh_draw_until || (draw_until > gHUD.m_flTime + duration)) {
refresh_draw_until = false;
draw_until = gHUD.m_flTime + duration;
}

if (gHUD.m_flTime >= draw_until) {
Expand Down

0 comments on commit 8b60bce

Please sign in to comment.