aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs13
1 files changed, 11 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 7ff30ca..a559683 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -2353,8 +2353,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2353 { 2353 {
2354 m_host.AddScriptLPS(1); 2354 m_host.AddScriptLPS(1);
2355 2355
2356
2357 SceneObjectPart rootPart = m_host.ParentGroup.RootPart;
2358
2359
2360 // 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
2361 // which is then treated like a child prim rotation and it's offset gets cumulatively multiplied against.
2362 // 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.
2363 // RootPart != null should shortcircuit
2364
2356 // try to let this work as in SL... 2365 // try to let this work as in SL...
2357 if (m_host.ParentID == 0) 2366 if (m_host.ParentID == 0 ) //|| (rootPart != null && m_host.LocalId == rootPart.LocalId))
2358 { 2367 {
2359 // special case: If we are root, rotate complete SOG to new rotation 2368 // special case: If we are root, rotate complete SOG to new rotation
2360 SetRot(m_host, rot); 2369 SetRot(m_host, rot);
@@ -2362,7 +2371,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2362 else 2371 else
2363 { 2372 {
2364 // we are a child. The rotation values will be set to the one of root modified by rot, as in SL. Don't ask. 2373 // we are a child. The rotation values will be set to the one of root modified by rot, as in SL. Don't ask.
2365 SceneObjectPart rootPart = m_host.ParentGroup.RootPart; 2374
2366 if (rootPart != null) // better safe than sorry 2375 if (rootPart != null) // better safe than sorry
2367 { 2376 {
2368 SetRot(m_host, rootPart.RotationOffset * (Quaternion)rot); 2377 SetRot(m_host, rootPart.RotationOffset * (Quaternion)rot);