diff options
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 76267ab..472c389 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1766,7 +1766,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1766 | 1766 | ||
1767 | if (m_parentID != 0) | 1767 | if (m_parentID != 0) |
1768 | { | 1768 | { |
1769 | SceneObjectPart part = m_scene.GetSceneObjectPart(m_parentID); | 1769 | SceneObjectPart part = m_scene.GetSceneObjectPart(m_requestedSitTargetID); |
1770 | if (part != null) | 1770 | if (part != null) |
1771 | { | 1771 | { |
1772 | part.TaskInventory.LockItemsForRead(true); | 1772 | part.TaskInventory.LockItemsForRead(true); |
@@ -2028,7 +2028,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2028 | //Console.WriteLine("Camera At ={0}", cameraAtOffset); | 2028 | //Console.WriteLine("Camera At ={0}", cameraAtOffset); |
2029 | //Console.WriteLine("Camera Eye ={0}", cameraEyeOffset); | 2029 | //Console.WriteLine("Camera Eye ={0}", cameraEyeOffset); |
2030 | 2030 | ||
2031 | ControllingClient.SendSitResponse(part.UUID, offsetr, sitOrientation, autopilot, cameraAtOffset, cameraEyeOffset, forceMouselook); | 2031 | //NOTE: SendSitResponse should be relative to the GROUP *NOT* THE PRIM if we're sitting on a child |
2032 | ControllingClient.SendSitResponse(part.ParentGroup.UUID, offsetr + part.OffsetPosition, sitOrientation, autopilot, cameraAtOffset, cameraEyeOffset, forceMouselook); | ||
2033 | |||
2032 | m_requestedSitTargetUUID = part.UUID; //KF: Correct autopilot target | 2034 | m_requestedSitTargetUUID = part.UUID; //KF: Correct autopilot target |
2033 | // This calls HandleAgentSit twice, once from here, and the client calls | 2035 | // This calls HandleAgentSit twice, once from here, and the client calls |
2034 | // HandleAgentSit itself after it gets to the location | 2036 | // HandleAgentSit itself after it gets to the location |
@@ -2398,7 +2400,17 @@ Console.WriteLine("Scripted Sit ofset {0}", m_pos); | |||
2398 | return; | 2400 | return; |
2399 | } | 2401 | } |
2400 | } | 2402 | } |
2401 | m_parentID = m_requestedSitTargetID; | 2403 | |
2404 | //We want our offsets to reference the root prim, not the child we may have sat on | ||
2405 | if (!part.IsRoot) | ||
2406 | { | ||
2407 | m_parentID = part.ParentGroup.RootPart.LocalId; | ||
2408 | m_pos += part.OffsetPosition; | ||
2409 | } | ||
2410 | else | ||
2411 | { | ||
2412 | m_parentID = m_requestedSitTargetID; | ||
2413 | } | ||
2402 | 2414 | ||
2403 | Velocity = Vector3.Zero; | 2415 | Velocity = Vector3.Zero; |
2404 | RemoveFromPhysicalScene(); | 2416 | RemoveFromPhysicalScene(); |