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;
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)
} 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) {
if (g_weapons[pSeat->m_iHUDWeaponSelected].isempty(pl))
HUD_DrawWeaponSelect_Back();
else if not (pl.g_items & g_weapons[pSeat->m_iHUDWeaponSelected].id)
} else if not (pl.g_items & g_weapons[pSeat->m_iHUDWeaponSelected].id)
HUD_DrawWeaponSelect_Back();
}