dont do recoil on llRezObject called from attachments, as seem to happen

at sl
avinationmerge
UbitUmarov 2014-11-18 10:37:46 +00:00
parent 140c0b3bb8
commit 07074d068b
1 changed files with 14 additions and 9 deletions

View File

@ -3269,6 +3269,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (new_groups == null)
return;
bool notAttachment = !m_host.ParentGroup.IsAttachment;
foreach (SceneObjectGroup group in new_groups)
{
// objects rezzed with this method are die_at_edge by default.
@ -3282,17 +3284,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
group.RootPart.UUID.ToString()) },
new DetectParams[0]));
float groupmass = group.GetMass();
PhysicsActor pa = group.RootPart.PhysActor;
//Recoil.
if (pa != null && pa.IsPhysical && (Vector3)vel != Vector3.Zero)
if (notAttachment)
{
Vector3 recoil = -vel * groupmass * m_recoilScaleFactor;
if (recoil != Vector3.Zero)
float groupmass = group.GetMass();
PhysicsActor pa = group.RootPart.PhysActor;
//Recoil.
if (pa != null && pa.IsPhysical && (Vector3)vel != Vector3.Zero)
{
llApplyImpulse(recoil, 0);
Vector3 recoil = -vel * groupmass * m_recoilScaleFactor;
if (recoil != Vector3.Zero)
{
llApplyImpulse(recoil, 0);
}
}
}
// Variable script delay? (see (http://wiki.secondlife.com/wiki/LSL_Delay)