mirror of
https://github.com/ValveSoftware/source-sdk-2013.git
synced 2025-01-16 08:48:01 +03:00
sp/src/game/shared/ragdoll_shared.cpp: PVS-Studio: CWE-476 (NULL Pointer Dereference)
This commit is contained in:
parent
0d8dceea43
commit
16a1731a32
@ -877,15 +877,16 @@ 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();
|
||||
|
||||
@ -920,10 +921,13 @@ void CRagdollLRURetirement::Update( float frametime ) // EPISODIC VERSION
|
||||
|
||||
CBaseAnimating *pRagdoll = m_LRU[i].Get();
|
||||
|
||||
//Just ignore it until we're done burning/dissolving.
|
||||
IPhysicsObject *pObject = pRagdoll->VPhysicsGetObject();
|
||||
if ( pRagdoll && (pRagdoll->GetEffectEntity() || ( pObject && !pObject->IsAsleep()) ) )
|
||||
continue;
|
||||
if ( pRagdoll )
|
||||
{
|
||||
//Just ignore it until we're done burning/dissolving.
|
||||
IPhysicsObject *pObject = pRagdoll->VPhysicsGetObject();
|
||||
if ( pRagdoll->GetEffectEntity() || ( pObject && !pObject->IsAsleep()) )
|
||||
continue;
|
||||
}
|
||||
|
||||
#ifdef CLIENT_DLL
|
||||
m_LRU[ i ]->SUB_Remove();
|
||||
|
Loading…
x
Reference in New Issue
Block a user