Fix a very unlikely-to-occur NullReferenceException race condition in llPushObject() where the code assumed that the physics actor it null-checked would still be null when it invoked a method on it
parent
12201bf7f4
commit
37ab587f27
|
@ -4541,6 +4541,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (pushAllowed)
|
||||
{
|
||||
float distance = (PusheePos - m_host.AbsolutePosition).Length();
|
||||
|
@ -4569,17 +4570,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
applied_linear_impulse *= scaling_factor;
|
||||
|
||||
}
|
||||
|
||||
if (pusheeIsAvatar)
|
||||
{
|
||||
if (pusheeav != null)
|
||||
{
|
||||
if (pusheeav.PhysicsActor != null)
|
||||
PhysicsActor pa = pusheeav.PhysicsActor;
|
||||
|
||||
if (pa != null)
|
||||
{
|
||||
if (local != 0)
|
||||
{
|
||||
applied_linear_impulse *= m_host.GetWorldRotation();
|
||||
}
|
||||
pusheeav.PhysicsActor.AddForce(applied_linear_impulse, true);
|
||||
|
||||
pa.AddForce(applied_linear_impulse, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue