Skip to content

Commit

Permalink
Fix HUD draw when not in game
Browse files Browse the repository at this point in the history
  • Loading branch information
evanlin96069 committed Aug 24, 2024
1 parent d6e21cf commit 82c8bda
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/achievement.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@ CONVAR(sar_hud_infinite_fall,
static void OnPaint(void) {
static HFont hud_font = 0;

if (!IsInGame())
return;

int mode = sar_hud_infinite_fall->val;
if (!mode)
return;
Expand Down
1 change: 1 addition & 0 deletions src/engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "vcall.h"

DECL_IFUNC(PUBLIC, void, engine_client, ClientCmd, 7, const char*);
DECL_IFUNC(PUBLIC, bool, engine_client, IsInGame, 26);

static bool Load(void) {
engine_server = engine_factory(INTERFACEVERSION_VENGINESERVER, NULL);
Expand Down
1 change: 1 addition & 0 deletions src/engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ typedef void* IVEngineServer;
typedef void* IVEngineClient;

void ClientCmd(const char* command);
bool IsInGame(void);

extern Module engine_module;

Expand Down

0 comments on commit 82c8bda

Please sign in to comment.