From 92c26e49947040a212db85ac4f59e5ba7f395856 Mon Sep 17 00:00:00 2001 From: teravus Date: Tue, 1 Jan 2013 23:55:24 -0500 Subject: * ubit pointed out another place where that check needed to be updated and I normalized it. --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 1fe095b..7e77b0f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2354,16 +2354,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.AddScriptLPS(1); - SceneObjectPart rootPart = m_host.ParentGroup.RootPart; - - // Teravus: if (m_host.ParentID == 0) is bug code because the ParentID for the Avatar will cause this to be nonzero for root prim attachments // which is then treated like a child prim rotation and it's offset gets cumulatively multiplied against. // to fix the scripted rotations we also have to check to see if the root part localid is the same as the host's localid. // RootPart != null should shortcircuit // try to let this work as in SL... - if (m_host.ParentID == 0 || (rootPart != null && m_host.LocalId == rootPart.LocalId)) + if (m_host.ParentID == 0 || (m_host.ParentGroup != null && m_host == m_host.ParentGroup.RootPart)) { // special case: If we are root, rotate complete SOG to new rotation SetRot(m_host, rot); @@ -2371,7 +2368,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api else { // we are a child. The rotation values will be set to the one of root modified by rot, as in SL. Don't ask. - + SceneObjectPart rootPart = m_host.ParentGroup.RootPart; if (rootPart != null) // better safe than sorry { SetRot(m_host, rootPart.RotationOffset * (Quaternion)rot); @@ -7920,7 +7917,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api LSL_Rotation q = rules.GetQuaternionItem(idx++); // try to let this work as in SL... - if (part.ParentID == 0) + if (part.ParentID == 0 || (part.ParentGroup != null && part == part.ParentGroup.RootPart)) { // special case: If we are root, rotate complete SOG to new rotation SetRot(part, q); -- cgit v1.1