Skip to content

Commit

Permalink
[game/shared] Fix nullptr ragdoll dereference in episode 1 & 2
Browse files Browse the repository at this point in the history
  • Loading branch information
dimhotepus committed Dec 9, 2024
1 parent 65df8d7 commit 393c18a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions game/shared/ragdoll_shared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -882,15 +882,15 @@ void CRagdollLRURetirement::Update( float frametime ) // EPISODIC VERSION

for ( i = m_LRU.Head(); i < m_LRU.InvalidIndex(); i = next )
{
CBaseAnimating *pRagdoll = m_LRU[i].Get();

next = m_LRU.Next(i);
IPhysicsObject *pObject = pRagdoll->VPhysicsGetObject();
if ( pRagdoll && (pRagdoll->GetEffectEntity() || ( pObject && !pObject->IsAsleep()) ) )
continue;


CBaseAnimating *pRagdoll = m_LRU[i].Get();
if ( pRagdoll )
{
IPhysicsObject *pObject = pRagdoll->VPhysicsGetObject();
if ( pRagdoll->GetEffectEntity() || ( pObject && !pObject->IsAsleep()) )
continue;

// float distToPlayer = (pPlayer->GetAbsOrigin() - pRagdoll->GetAbsOrigin()).LengthSqr();
float distToPlayer = (PlayerOrigin - pRagdoll->GetAbsOrigin()).LengthSqr();

Expand Down

0 comments on commit 393c18a

Please sign in to comment.