diff --git a/dlls/player.cpp b/dlls/player.cpp index cce57d02..e4d7f0fb 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -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(); } diff --git a/dlls/weapons.cpp b/dlls/weapons.cpp index 76e5408d..094a4f38 100644 --- a/dlls/weapons.cpp +++ b/dlls/weapons.cpp @@ -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; diff --git a/dlls/weapons.h b/dlls/weapons.h index c5f0d46a..396f3724 100644 --- a/dlls/weapons.h +++ b/dlls/weapons.h @@ -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