PhysCallbackDamage() queues up the damage event so it occurs after
simulation is finished.  The normal code path for TakeDamage() handles
this automatically.  So it's fine to call TakeDamage() from a callback.
Calling UTIL_Remove() or delete on an entity during a callback may
corrupt vphysics.

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of
> [EMAIL PROTECTED]
> Sent: Thursday, June 29, 2006 9:03 PM
> To: [email protected]
> Subject: Re: [hlcoders] Physical Mayhem bug again! Death by
> Touch considered harmful??
>
> Apparently what's bad is doing damage while vphysics.dll has
> done a callback for one of its ShouldCollide things or
> something.  Inside the CBaseEntity::TakeDamage there is this code:
>
> if (PhysIsInCallback()) {
>     PhysCallbackDamage(this, inputInfo); } else  {
>     ... actually do the damage...
> }
>
> So as far as I can tell damage inside a Touch should be legal
> as far as the physics is concerned.  Can Valve please confirm?
>
> However as a test I've changed my code inside the touch
> function to do a PhysCallbackDamage() ... will see if it
> makes a difference.
>
> At 2006/06/25 01:52 PM, [EMAIL PROTECTED] wrote:
> >After a month or so without the commonplace Physical Mayhem
> bug that repros in HL2DM, I have now managed to create a new
> Physical Mayhem bug that's possibly unique to my mod, or at
> least to mods with similar features.  This one is a bit
> harder to repro - I've only seen it twice in the last week or so.
> >
> >It seems to be tied to a recent code change (or is otherwise
> a great coincidence) that allows for high-speed players to do
> damage to each other when they collide.  So what I'm
> suspicious of is this: is there some undocumented bug/feature
> in vphysics.dll that could cause Physical Mayhem if players
> died or fragged while in the CHL2MP_Player::Touch(CBaseEntity
> *pOther) function?
> >
> >I could theoretically add a delay mechanism to take note of
> the damage and come back and apply the damage later.  I'm
> extra suspicious this may be required because
> CCollisionEvent::AddDamageEvent seems to be doing just that
> sort of thing.
> >
> >_______________________________________________
> >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
>
>

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

Reply via email to