Check for physics

► Checked if what we are picking up is a physics object.
This commit is contained in:
speedvoltage 2025-03-09 17:24:46 +01:00
parent a62efecf62
commit 59f00ceadb

View file

@ -792,6 +792,13 @@ void CPlayerPickupController::Use( CBaseEntity *pActivator, CBaseEntity *pCaller
//Adrian: Oops, our object became motion disabled, let go!
IPhysicsObject *pPhys = pAttached->VPhysicsGetObject();
if ( !pPhys )
{
Shutdown();
return;
}
if ( pPhys && pPhys->IsMoveable() == false )
{
Shutdown();
@ -808,7 +815,7 @@ void CPlayerPickupController::Use( CBaseEntity *pActivator, CBaseEntity *pCaller
}
#endif
// +ATTACK will throw phys objects
if ( m_pPlayer->m_nButtons & IN_ATTACK )
if ( pPhys && m_pPlayer->m_nButtons & IN_ATTACK )
{
Shutdown( true );
Vector vecLaunch;