mirror of
https://github.com/FWGS/hlsdk-xash3d
synced 2024-11-22 01:47:45 +01:00
Fix deploy animations on fast weapon switching (#289)
This commit is contained in:
parent
25ba2b4e5f
commit
ed676a5413
@ -3095,7 +3095,15 @@ void CBasePlayer::SelectItem( const char *pstr )
|
||||
|
||||
if( m_pActiveItem )
|
||||
{
|
||||
CBasePlayerWeapon* weapon = (CBasePlayerWeapon*)(m_pActiveItem->GetWeaponPtr());
|
||||
if (weapon)
|
||||
weapon->m_ForceSendAnimations = true;
|
||||
|
||||
m_pActiveItem->Deploy();
|
||||
|
||||
if (weapon)
|
||||
weapon->m_ForceSendAnimations = false;
|
||||
|
||||
m_pActiveItem->UpdateItemInfo();
|
||||
}
|
||||
}
|
||||
@ -3121,7 +3129,16 @@ void CBasePlayer::SelectLastItem( void )
|
||||
CBasePlayerItem *pTemp = m_pActiveItem;
|
||||
m_pActiveItem = m_pLastItem;
|
||||
m_pLastItem = pTemp;
|
||||
|
||||
CBasePlayerWeapon* weapon = (CBasePlayerWeapon*)(m_pActiveItem->GetWeaponPtr());
|
||||
if (weapon)
|
||||
weapon->m_ForceSendAnimations = true;
|
||||
|
||||
m_pActiveItem->Deploy();
|
||||
|
||||
if (weapon)
|
||||
weapon->m_ForceSendAnimations = false;
|
||||
|
||||
m_pActiveItem->UpdateItemInfo();
|
||||
}
|
||||
|
||||
|
@ -820,7 +820,7 @@ int CBasePlayerWeapon::UpdateClientData( CBasePlayer *pPlayer )
|
||||
void CBasePlayerWeapon::SendWeaponAnim( int iAnim, int skiplocal, int body )
|
||||
{
|
||||
if( UseDecrement() )
|
||||
skiplocal = 1;
|
||||
skiplocal = !m_ForceSendAnimations;
|
||||
else
|
||||
skiplocal = 0;
|
||||
|
||||
|
@ -351,6 +351,9 @@ public:
|
||||
// hle time creep vars
|
||||
float m_flPrevPrimaryAttack;
|
||||
float m_flLastFireTime;
|
||||
|
||||
//Hack so deploy animations work when weapon prediction is enabled.
|
||||
bool m_ForceSendAnimations;
|
||||
};
|
||||
|
||||
class CBasePlayerAmmo : public CBaseEntity
|
||||
|
Loading…
Reference in New Issue
Block a user