From d23160602041beddb57f6d04c01e47b3e10bc1ea Mon Sep 17 00:00:00 2001 From: Blixibon Date: Sun, 16 Oct 2022 15:12:59 -0500 Subject: [PATCH] Fixed crash when a prop_dynamic with a model scale has no physics object --- sp/src/game/server/baseanimating.cpp | 4 ++-- sp/src/game/server/props.cpp | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/sp/src/game/server/baseanimating.cpp b/sp/src/game/server/baseanimating.cpp index 74a9343e..38b1606a 100644 --- a/sp/src/game/server/baseanimating.cpp +++ b/sp/src/game/server/baseanimating.cpp @@ -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 ); diff --git a/sp/src/game/server/props.cpp b/sp/src/game/server/props.cpp index 78675b7a..440566ba 100644 --- a/sp/src/game/server/props.cpp +++ b/sp/src/game/server/props.cpp @@ -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 }