mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-01-11 15:38:12 +00: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 )
|
if( m_pActiveItem )
|
||||||
{
|
{
|
||||||
|
CBasePlayerWeapon* weapon = (CBasePlayerWeapon*)(m_pActiveItem->GetWeaponPtr());
|
||||||
|
if (weapon)
|
||||||
|
weapon->m_ForceSendAnimations = true;
|
||||||
|
|
||||||
m_pActiveItem->Deploy();
|
m_pActiveItem->Deploy();
|
||||||
|
|
||||||
|
if (weapon)
|
||||||
|
weapon->m_ForceSendAnimations = false;
|
||||||
|
|
||||||
m_pActiveItem->UpdateItemInfo();
|
m_pActiveItem->UpdateItemInfo();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3121,7 +3129,16 @@ void CBasePlayer::SelectLastItem( void )
|
|||||||
CBasePlayerItem *pTemp = m_pActiveItem;
|
CBasePlayerItem *pTemp = m_pActiveItem;
|
||||||
m_pActiveItem = m_pLastItem;
|
m_pActiveItem = m_pLastItem;
|
||||||
m_pLastItem = pTemp;
|
m_pLastItem = pTemp;
|
||||||
|
|
||||||
|
CBasePlayerWeapon* weapon = (CBasePlayerWeapon*)(m_pActiveItem->GetWeaponPtr());
|
||||||
|
if (weapon)
|
||||||
|
weapon->m_ForceSendAnimations = true;
|
||||||
|
|
||||||
m_pActiveItem->Deploy();
|
m_pActiveItem->Deploy();
|
||||||
|
|
||||||
|
if (weapon)
|
||||||
|
weapon->m_ForceSendAnimations = false;
|
||||||
|
|
||||||
m_pActiveItem->UpdateItemInfo();
|
m_pActiveItem->UpdateItemInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -820,7 +820,7 @@ int CBasePlayerWeapon::UpdateClientData( CBasePlayer *pPlayer )
|
|||||||
void CBasePlayerWeapon::SendWeaponAnim( int iAnim, int skiplocal, int body )
|
void CBasePlayerWeapon::SendWeaponAnim( int iAnim, int skiplocal, int body )
|
||||||
{
|
{
|
||||||
if( UseDecrement() )
|
if( UseDecrement() )
|
||||||
skiplocal = 1;
|
skiplocal = !m_ForceSendAnimations;
|
||||||
else
|
else
|
||||||
skiplocal = 0;
|
skiplocal = 0;
|
||||||
|
|
||||||
|
@ -351,6 +351,9 @@ public:
|
|||||||
// hle time creep vars
|
// hle time creep vars
|
||||||
float m_flPrevPrimaryAttack;
|
float m_flPrevPrimaryAttack;
|
||||||
float m_flLastFireTime;
|
float m_flLastFireTime;
|
||||||
|
|
||||||
|
//Hack so deploy animations work when weapon prediction is enabled.
|
||||||
|
bool m_ForceSendAnimations;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CBasePlayerAmmo : public CBaseEntity
|
class CBasePlayerAmmo : public CBaseEntity
|
||||||
|
Loading…
Reference in New Issue
Block a user