diff options
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 20 |
2 files changed, 22 insertions, 4 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 7403fed..09c945b 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -711,6 +711,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
711 | // Tell the physics engines that this prim changed. | 711 | // Tell the physics engines that this prim changed. |
712 | m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor); | 712 | m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor); |
713 | } | 713 | } |
714 | |||
715 | List<ScenePresence> avs = ParentGroup.GetLinkedAvatars(); | ||
716 | foreach (ScenePresence av in avs) | ||
717 | { | ||
718 | av.SendFullUpdateToAllClients(); | ||
719 | } | ||
714 | } | 720 | } |
715 | } | 721 | } |
716 | } | 722 | } |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 76267ab..a376ab1 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); |
@@ -1822,7 +1822,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1822 | //CW: If the part isn't null then we can set the current position | 1822 | //CW: If the part isn't null then we can set the current position |
1823 | if (part != null) | 1823 | if (part != null) |
1824 | { | 1824 | { |
1825 | Vector3 avWorldStandUp = avStandUp + part.GetWorldPosition() + (m_pos * partRot); // + av sit offset! | 1825 | Vector3 avWorldStandUp = avStandUp + part.GetWorldPosition() + ((m_pos - part.OffsetPosition) * partRot); // + av sit offset! |
1826 | AbsolutePosition = avWorldStandUp; //KF: Fix stand up. | 1826 | AbsolutePosition = avWorldStandUp; //KF: Fix stand up. |
1827 | part.IsOccupied = false; | 1827 | part.IsOccupied = false; |
1828 | part.ParentGroup.DeleteAvatar(ControllingClient.AgentId); | 1828 | part.ParentGroup.DeleteAvatar(ControllingClient.AgentId); |
@@ -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(); |