Merge branch 'ubitwork' into avination
commit
f0f928dce1
|
@ -3129,13 +3129,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
new_group.RootPart.UUID.ToString()) },
|
new_group.RootPart.UUID.ToString()) },
|
||||||
new DetectParams[0]));
|
new DetectParams[0]));
|
||||||
|
|
||||||
float groupmass = new_group.GetMass();
|
// do recoil
|
||||||
|
SceneObjectGroup hostgrp = m_host.ParentGroup;
|
||||||
|
if (hostgrp == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (hostgrp.IsAttachment) // don't recoil avatars
|
||||||
|
return;
|
||||||
|
|
||||||
PhysicsActor pa = new_group.RootPart.PhysActor;
|
PhysicsActor pa = new_group.RootPart.PhysActor;
|
||||||
|
|
||||||
if (pa != null && pa.IsPhysical && llvel != Vector3.Zero)
|
if (pa != null && pa.IsPhysical && llvel != Vector3.Zero)
|
||||||
{
|
{
|
||||||
// recoil
|
float groupmass = new_group.GetMass();
|
||||||
llvel *= -groupmass;
|
llvel *= -groupmass;
|
||||||
llApplyImpulse(new LSL_Vector(llvel.X, llvel.Y,llvel.Z), 0);
|
llApplyImpulse(new LSL_Vector(llvel.X, llvel.Y,llvel.Z), 0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue