From 64048e9b326e0806dc3ff202961c3f159898a4ea Mon Sep 17 00:00:00 2001 From: Marco Cawthorne Date: Fri, 5 Aug 2022 22:36:12 -0700 Subject: [PATCH] HUD: sanity check before calling isempty... --- src/client/hud_weaponselect.qc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/client/hud_weaponselect.qc b/src/client/hud_weaponselect.qc index 2a15dd7..55066a3 100644 --- a/src/client/hud_weaponselect.qc +++ b/src/client/hud_weaponselect.qc @@ -46,9 +46,10 @@ HUD_DrawWeaponSelect_Forward(void) pSeat->m_flHUDWeaponSelectTime = time + 3; - if (g_weapons[pSeat->m_iHUDWeaponSelected].isempty(pl)) - HUD_DrawWeaponSelect_Forward(); - else if not (pl.g_items & g_weapons[pSeat->m_iHUDWeaponSelected].id) + if (g_weapons[pSeat->m_iHUDWeaponSelected].isempty) { + if (g_weapons[pSeat->m_iHUDWeaponSelected].isempty(pl)) + HUD_DrawWeaponSelect_Forward(); + } else if not (pl.g_items & g_weapons[pSeat->m_iHUDWeaponSelected].id) HUD_DrawWeaponSelect_Forward(); } @@ -74,9 +75,10 @@ HUD_DrawWeaponSelect_Back(void) pSeat->m_flHUDWeaponSelectTime = time + 3; - if (g_weapons[pSeat->m_iHUDWeaponSelected].isempty(pl)) - HUD_DrawWeaponSelect_Back(); - else if not (pl.g_items & g_weapons[pSeat->m_iHUDWeaponSelected].id) + if (g_weapons[pSeat->m_iHUDWeaponSelected].isempty) { + if (g_weapons[pSeat->m_iHUDWeaponSelected].isempty(pl)) + HUD_DrawWeaponSelect_Back(); + } else if not (pl.g_items & g_weapons[pSeat->m_iHUDWeaponSelected].id) HUD_DrawWeaponSelect_Back(); }