aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs28
1 files changed, 27 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index faa92dc..0dfcfd6 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -2443,6 +2443,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2443 2443
2444 m_host.AddScriptLPS(1); 2444 m_host.AddScriptLPS(1);
2445 Quaternion q = m_host.GetWorldRotation(); 2445 Quaternion q = m_host.GetWorldRotation();
2446
2447 if (m_host.ParentGroup != null && m_host.ParentGroup.AttachmentPoint != 0)
2448 {
2449 ScenePresence avatar = World.GetScenePresence(m_host.ParentGroup.AttachedAvatar);
2450 if (avatar != null)
2451 {
2452 if ((avatar.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0)
2453 q = avatar.CameraRotation * q; // Mouselook
2454 else
2455 q = avatar.Rotation * q; // Currently infrequently updated so may be inaccurate
2456 }
2457 }
2458
2446 return new LSL_Rotation(q.X, q.Y, q.Z, q.W); 2459 return new LSL_Rotation(q.X, q.Y, q.Z, q.W);
2447 } 2460 }
2448 2461
@@ -2468,7 +2481,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2468 q = part.ParentGroup.GroupRotation; // just the group rotation 2481 q = part.ParentGroup.GroupRotation; // just the group rotation
2469 return new LSL_Rotation(q.X, q.Y, q.Z, q.W); 2482 return new LSL_Rotation(q.X, q.Y, q.Z, q.W);
2470 } 2483 }
2484
2471 q = part.GetWorldRotation(); 2485 q = part.GetWorldRotation();
2486 if (part.ParentGroup.AttachmentPoint != 0)
2487 {
2488 ScenePresence avatar = World.GetScenePresence(part.ParentGroup.AttachedAvatar);
2489 if (avatar != null)
2490 {
2491 if ((avatar.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0)
2492 q = avatar.CameraRotation * q; // Mouselook
2493 else
2494 q = avatar.Rotation * q; // Currently infrequently updated so may be inaccurate
2495 }
2496 }
2497
2472 return new LSL_Rotation(q.X, q.Y, q.Z, q.W); 2498 return new LSL_Rotation(q.X, q.Y, q.Z, q.W);
2473 } 2499 }
2474 2500
@@ -8709,7 +8735,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8709 8735
8710 LSL_List remaining = GetPrimParams(m_host, rules, ref result); 8736 LSL_List remaining = GetPrimParams(m_host, rules, ref result);
8711 8737
8712 while (remaining != null && remaining.Length > 2) 8738 while ((object)remaining != null && remaining.Length > 2)
8713 { 8739 {
8714 int linknumber = remaining.GetLSLIntegerItem(0); 8740 int linknumber = remaining.GetLSLIntegerItem(0);
8715 rules = remaining.GetSublist(1, -1); 8741 rules = remaining.GetSublist(1, -1);