Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Ivan Molodetskikh <[email protected]>
  • Loading branch information
sabianroberts and YaLTeR authored Nov 14, 2024
1 parent 8b60bce commit bb825e4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cl_dll/hud_watermark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include "update_checker.h"

extern cvar_t* hud_watermark;
float duration = 15.0f;

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

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

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

if (gHUD.m_flTime >= draw_until) {
Expand All @@ -41,13 +41,13 @@ int CHudWatermark::Draw(float time)
int r, g, b;
UnpackRGB(r, g, b, gHUD.m_iDefaultHUDColor);

if (hud_watermark->value != 0)
{
if (hud_watermark->value != 0) {
gEngfuncs.pfnDrawString(ScreenWidth / 20, gHUD.m_scrinfo.iCharHeight, "OpenAG client build " __DATE__, r, g, b);
gEngfuncs.pfnDrawString(ScreenWidth / 20, gHUD.m_scrinfo.iCharHeight * 2, "j.mp/OpenAG", r, g, b);
}

if (update_is_available)
gEngfuncs.pfnDrawString(ScreenWidth / 20, gHUD.m_scrinfo.iCharHeight / 2 * 7, "An update is available.", r, g, b);

return 0;
}

0 comments on commit bb825e4

Please sign in to comment.