Well, you don't check if pRagdollPhys is a NULL-pointer.

----- Original Message ----- 
From: "Kyle Gospodnetich" <[email protected]>
To: "Discussion of Half-Life Programming" <[email protected]>
Sent: Sunday, July 05, 2009 3:25 AM
Subject: [hlcoders] Hopwire Vortex issues - Need a little help


> Hello everyone. I'm working on a new weapon for a little project of
> mine, and I decided that the hopwire's vortex effect would be perfect
> for it's secondary attack. The problem is, when the hopwire goes off, it
> crashes if a player is too close to it. This problem is only present on
> the orange box engine, as a clean EP1 engine compile seems to work just
> fine. According to the dumps, this is the line that's crashing.
>
> grenade_hopwire.cpp
>    // Ragdolls need to report the sum of all their parts
>    CRagdollProp *pRagdoll = dynamic_cast< CRagdollProp* >( pEnt );
>    if ( pRagdoll != NULL )
>    {
>        // Find the aggregate mass of the whole ragdoll
>        ragdoll_t *pRagdollPhys = pRagdoll->GetRagdoll();
>        for ( int j = 0; j < pRagdollPhys->listCount; ++j )
>        {
>            m_flMass += pRagdollPhys->list[j].pObject->GetMass();
>        }
>    }
>    else
>    {
>        // Otherwise we just take the normal mass
>        >>>>>>m_flMass += pPhysObject->GetMass();
>    }
>
> It's giving a negative mass. What's weird is, even if I hard code the
> mass ( m_flMass = 10000; ) , it still crashes with a negative mass.
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives, 
> please visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
> 


_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to