diff options
author | teravus | 2013-01-01 23:55:24 -0500 |
---|---|---|
committer | teravus | 2013-01-01 23:55:24 -0500 |
commit | 92c26e49947040a212db85ac4f59e5ba7f395856 (patch) | |
tree | 0a19f3f785d28411c9757a954e6b4461caf68c7d /OpenSim | |
parent | * This is actually the fix described the last commit.. I had commented it o... (diff) | |
download | opensim-SC_OLD-92c26e49947040a212db85ac4f59e5ba7f395856.zip opensim-SC_OLD-92c26e49947040a212db85ac4f59e5ba7f395856.tar.gz opensim-SC_OLD-92c26e49947040a212db85ac4f59e5ba7f395856.tar.bz2 opensim-SC_OLD-92c26e49947040a212db85ac4f59e5ba7f395856.tar.xz |
* ubit pointed out another place where that check needed to be updated and I normalized it.
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 9 |
1 files changed, 3 insertions, 6 deletions
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 | |||
2354 | m_host.AddScriptLPS(1); | 2354 | m_host.AddScriptLPS(1); |
2355 | 2355 | ||
2356 | 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 | 2357 | // 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. | 2358 | // 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. | 2359 | // 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 | 2360 | // RootPart != null should shortcircuit |
2364 | 2361 | ||
2365 | // try to let this work as in SL... | 2362 | // try to let this work as in SL... |
2366 | if (m_host.ParentID == 0 || (rootPart != null && m_host.LocalId == rootPart.LocalId)) | 2363 | if (m_host.ParentID == 0 || (m_host.ParentGroup != null && m_host == m_host.ParentGroup.RootPart)) |
2367 | { | 2364 | { |
2368 | // special case: If we are root, rotate complete SOG to new rotation | 2365 | // special case: If we are root, rotate complete SOG to new rotation |
2369 | SetRot(m_host, rot); | 2366 | SetRot(m_host, rot); |
@@ -2371,7 +2368,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2371 | else | 2368 | else |
2372 | { | 2369 | { |
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. | 2370 | // we are a child. The rotation values will be set to the one of root modified by rot, as in SL. Don't ask. |
2374 | 2371 | SceneObjectPart rootPart = m_host.ParentGroup.RootPart; | |
2375 | if (rootPart != null) // better safe than sorry | 2372 | if (rootPart != null) // better safe than sorry |
2376 | { | 2373 | { |
2377 | SetRot(m_host, rootPart.RotationOffset * (Quaternion)rot); | 2374 | SetRot(m_host, rootPart.RotationOffset * (Quaternion)rot); |
@@ -7920,7 +7917,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7920 | 7917 | ||
7921 | LSL_Rotation q = rules.GetQuaternionItem(idx++); | 7918 | LSL_Rotation q = rules.GetQuaternionItem(idx++); |
7922 | // try to let this work as in SL... | 7919 | // try to let this work as in SL... |
7923 | if (part.ParentID == 0) | 7920 | if (part.ParentID == 0 || (part.ParentGroup != null && part == part.ParentGroup.RootPart)) |
7924 | { | 7921 | { |
7925 | // special case: If we are root, rotate complete SOG to new rotation | 7922 | // special case: If we are root, rotate complete SOG to new rotation |
7926 | SetRot(part, q); | 7923 | SetRot(part, q); |