HUD: Only call weapon switch if we're going to a different weapon.

This commit is contained in:
Marco Cawthorne 2022-08-03 17:55:57 -07:00
parent 63f5ebe014
commit d457262d0c
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
1 changed files with 5 additions and 1 deletions

View File

@ -82,8 +82,12 @@ void
HUD_DrawWeaponSelect_Trigger(void)
{
player pl = (player)pSeat->m_ePlayer;
if (pl.activeweapon != pSeat->m_iHUDWeaponSelected)
sendevent("PlayerSwitchWeapon", "i", pSeat->m_iHUDWeaponSelected);
pl.activeweapon = pSeat->m_iHUDWeaponSelected;
sendevent("PlayerSwitchWeapon", "i", pSeat->m_iHUDWeaponSelected);
sound(pSeat->m_ePlayer, CHAN_ITEM, "common/wpn_select.wav", 0.5f, ATTN_NONE);
pSeat->m_iHUDWeaponSelected = pSeat->m_flHUDWeaponSelectTime = 0;
}