Fixed a crash involving player +USE anims

This commit is contained in:
Blixibon 2022-07-16 13:16:45 -05:00
parent fe518c9859
commit a4657d0cf1

View File

@ -1397,7 +1397,7 @@ Activity CHL2_Player::Weapon_TranslateActivity( Activity baseAct, bool *pRequire
{ {
CBaseEntity* pHeldEnt = GetPlayerHeldEntity( this ); CBaseEntity* pHeldEnt = GetPlayerHeldEntity( this );
float flMass = pHeldEnt ? float flMass = pHeldEnt ?
PlayerPickupGetHeldObjectMass( m_hUseEntity, pHeldEnt->VPhysicsGetObject() ) : (pHeldEnt->VPhysicsGetObject() ? PlayerPickupGetHeldObjectMass( m_hUseEntity, pHeldEnt->VPhysicsGetObject() ) : player_use_anim_heavy_mass.GetFloat()) :
(m_hUseEntity->VPhysicsGetObject() ? m_hUseEntity->GetMass() : player_use_anim_heavy_mass.GetFloat()); (m_hUseEntity->VPhysicsGetObject() ? m_hUseEntity->GetMass() : player_use_anim_heavy_mass.GetFloat());
if ( flMass >= player_use_anim_heavy_mass.GetFloat() ) if ( flMass >= player_use_anim_heavy_mass.GetFloat() )
{ {