From 7f0350b98858309d8c6e8b7689c2efdf12ca60b9 Mon Sep 17 00:00:00 2001 From: Marck Date: Sun, 12 Dec 2010 20:06:23 +0100 Subject: Trigger event with flag CHANGED_LINK when agent sits on objects that have not a sit target defined. This fixes Mantis #4692. --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 7 ------- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 8 ++++++-- 2 files changed, 6 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index f87056e..4fcd8f5 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -3251,13 +3251,6 @@ namespace OpenSim.Region.Framework.Scenes //} } - public void SetAvatarOnSitTarget(UUID avatarID) - { - m_sitTargetAvatar = avatarID; - if (ParentGroup != null) - ParentGroup.TriggerScriptChangedEvent(Changed.LINK); - } - public void SetAxisRotation(int axis, int rotate) { if (m_parentGroup != null) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index f64d539..30c9365 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1703,7 +1703,9 @@ namespace OpenSim.Region.Framework.Scenes } // Reset sit target. if (part.GetAvatarOnSitTarget() == UUID) - part.SetAvatarOnSitTarget(UUID.Zero); + part.SitTargetAvatar = UUID.Zero; + if (part.ParentGroup != null) + part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK); m_parentPosition = part.GetWorldPosition(); ControllingClient.SendClearFollowCamProperties(part.ParentUUID); @@ -1807,11 +1809,13 @@ namespace OpenSim.Region.Framework.Scenes if (SitTargetisSet && SitTargetUnOccupied) { - part.SetAvatarOnSitTarget(UUID); + part.SitTargetAvatar = UUID; offset = new Vector3(avSitOffSet.X, avSitOffSet.Y, avSitOffSet.Z); sitOrientation = avSitOrientation; autopilot = false; } + if (part.ParentGroup != null) + part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK); pos = part.AbsolutePosition + offset; //if (Math.Abs(part.AbsolutePosition.Z - AbsolutePosition.Z) > 1) -- cgit v1.1