Fixed crash when a prop_dynamic with a model scale has no physics object

This commit is contained in:
Blixibon 2022-10-16 15:12:59 -05:00
parent 6945ef2468
commit d231606020
2 changed files with 2 additions and 6 deletions

View File

@ -2930,9 +2930,9 @@ void CBaseAnimating::InvalidateBoneCache( void )
bool CBaseAnimating::TestCollision( const Ray_t &ray, unsigned int fContentsMask, trace_t& tr )
{
// Return a special case for scaled physics objects
if ( GetModelScale() != 1.0f )
IPhysicsObject *pPhysObject = VPhysicsGetObject();
if ( GetModelScale() != 1.0f && pPhysObject )
{
IPhysicsObject *pPhysObject = VPhysicsGetObject();
Vector vecPosition;
QAngle vecAngles;
pPhysObject->GetPosition( &vecPosition, &vecAngles );

View File

@ -2283,11 +2283,7 @@ bool CDynamicProp::TestCollision( const Ray_t &ray, unsigned int mask, trace_t&
}
}
}
#ifdef MAPBASE // From Alien Swarm SDK
return BaseClass::TestCollision( ray, mask, trace );
#else
return false;
#endif
}