Only send pain sound in freeze if fire was released

This commit is contained in:
trml 2020-08-25 22:45:23 +02:00
parent 955ccb9995
commit c98a1f0a59

View file

@ -367,7 +367,7 @@ void CCharacter::FireWeapon()
if(CountInput(m_LatestPrevInput.m_Fire, m_LatestInput.m_Fire).m_Presses)
WillFire = true;
if(FullAuto && (m_LatestInput.m_Fire&1) && m_aWeapons[m_Core.m_ActiveWeapon].m_Ammo && !m_FreezeTime)
if(FullAuto && (m_LatestInput.m_Fire&1) && m_aWeapons[m_Core.m_ActiveWeapon].m_Ammo)
WillFire = true;
if(!WillFire)
@ -376,7 +376,7 @@ void CCharacter::FireWeapon()
if (m_FreezeTime)
{
// Timer stuff to avoid shrieking orchestra caused by unfreeze-plasma
if(m_PainSoundTimer<=0)
if(m_PainSoundTimer<=0 && !(m_LatestPrevInput.m_Fire&1))
{
m_PainSoundTimer = 1 * Server()->TickSpeed();
GameServer()->CreateSound(m_Pos, SOUND_PLAYER_PAIN_LONG, Teams()->TeamMask(Team(), -1, m_pPlayer->GetCID()));