HUD: sanity check before calling isempty...

This commit is contained in:
Marco Cawthorne 2022-08-05 22:36:12 -07:00
parent f82bef274a
commit 64048e9b32
Signed by: eukara
GPG key ID: CE2032F0A2882A22

View file

@ -46,9 +46,10 @@ HUD_DrawWeaponSelect_Forward(void)
pSeat->m_flHUDWeaponSelectTime = time + 3; pSeat->m_flHUDWeaponSelectTime = time + 3;
if (g_weapons[pSeat->m_iHUDWeaponSelected].isempty(pl)) if (g_weapons[pSeat->m_iHUDWeaponSelected].isempty) {
HUD_DrawWeaponSelect_Forward(); if (g_weapons[pSeat->m_iHUDWeaponSelected].isempty(pl))
else if not (pl.g_items & g_weapons[pSeat->m_iHUDWeaponSelected].id) HUD_DrawWeaponSelect_Forward();
} else if not (pl.g_items & g_weapons[pSeat->m_iHUDWeaponSelected].id)
HUD_DrawWeaponSelect_Forward(); HUD_DrawWeaponSelect_Forward();
} }
@ -74,9 +75,10 @@ HUD_DrawWeaponSelect_Back(void)
pSeat->m_flHUDWeaponSelectTime = time + 3; pSeat->m_flHUDWeaponSelectTime = time + 3;
if (g_weapons[pSeat->m_iHUDWeaponSelected].isempty(pl)) if (g_weapons[pSeat->m_iHUDWeaponSelected].isempty) {
HUD_DrawWeaponSelect_Back(); if (g_weapons[pSeat->m_iHUDWeaponSelected].isempty(pl))
else if not (pl.g_items & g_weapons[pSeat->m_iHUDWeaponSelected].id) HUD_DrawWeaponSelect_Back();
} else if not (pl.g_items & g_weapons[pSeat->m_iHUDWeaponSelected].id)
HUD_DrawWeaponSelect_Back(); HUD_DrawWeaponSelect_Back();
} }