From 42a79611420d89d0c74de6ef5f83c11fd8293554 Mon Sep 17 00:00:00 2001 From: 8dcc <8dcc.git@gmail.com> Date: Mon, 31 Jul 2023 20:10:27 +0200 Subject: [PATCH] Store clip from HUD_PostRunCmd --- src/globals.c | 3 +++ src/hooks.c | 1 + src/include/globals.h | 1 + 3 files changed, 5 insertions(+) diff --git a/src/globals.c b/src/globals.c index 07a4108..e466659 100644 --- a/src/globals.c +++ b/src/globals.c @@ -10,7 +10,10 @@ game_id this_game_id = HL; vec3_t g_punchAngles = { 0, 0, 0 }; + +/* Weapon info */ float g_flNextAttack = 0.f, g_flNextPrimaryAttack = 0.f; +int g_iClip = 0; void* hw; void** h_client; diff --git a/src/hooks.c b/src/hooks.c index b9bbeaa..98838e9 100644 --- a/src/hooks.c +++ b/src/hooks.c @@ -111,6 +111,7 @@ void h_HUD_PostRunCmd(struct local_state_s* from, struct local_state_s* to, g_flNextAttack = to->client.m_flNextAttack; g_flNextPrimaryAttack = to->weapondata[to->client.m_iId].m_flNextPrimaryAttack; + g_iClip = to->weapondata[to->client.m_iId].m_iClip; } } diff --git a/src/include/globals.h b/src/include/globals.h index 1624985..b89e08c 100644 --- a/src/include/globals.h +++ b/src/include/globals.h @@ -36,6 +36,7 @@ enum game_id { extern game_id this_game_id; extern vec3_t g_punchAngles; extern float g_flNextAttack, g_flNextPrimaryAttack; +extern int g_iClip; extern void* hw; extern void** h_client; /* hClientDLL hander */