From e296f25445ef5d0fc8d114aed6241da664c57b34 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 1 Aug 2014 19:52:55 +0100 Subject: [PATCH] sitting avatars hidding by their position. This is not as SL that uses avatar sitting on root prim. All cases have good and bad situations, this is simpler. Only SOG position changes triggers checks, rotation alone will not. ( as happens in other cases ) (UNTESTED, as usual ) --- .../Framework/Scenes/SceneObjectGroup.cs | 5 +++ .../Region/Framework/Scenes/ScenePresence.cs | 36 ++++++++++++++++++- 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index ba97c47b90..28758a9e13 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -701,6 +701,11 @@ namespace OpenSim.Region.Framework.Scenes part.GroupPosition = val; } + foreach (ScenePresence av in m_linkedAvatars) + { + av.sitSOGmoved(); + } + // now that position is changed tell it to scripts if (triggerScriptEvent) { diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index ae14af21c8..494c9e0008 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -163,6 +163,7 @@ namespace OpenSim.Region.Framework.Scenes } m_currentParcelUUID = value; m_currentParcelHide = false; + ILandObject land = m_scene.LandChannel.GetLandObject(AbsolutePosition.X, AbsolutePosition.Y); if (land != null && !land.LandData.SeeAVs) m_currentParcelHide = true; @@ -172,6 +173,23 @@ namespace OpenSim.Region.Framework.Scenes } } + public void sitSOGmoved() + { + if (IsDeleted || !IsSatOnObject) + //what me? nahh + return; + if (IsInTransit) + return; + + ILandObject land = m_scene.LandChannel.GetLandObject(AbsolutePosition.X, AbsolutePosition.Y); + if (land == null) + return; //?? + UUID parcelID = land.LandData.GlobalID; + if (m_currentParcelUUID != parcelID) + currentParcelUUID = parcelID; + } + + public bool ParcelAllowThisAvatarSounds { get @@ -2707,7 +2725,7 @@ namespace OpenSim.Region.Framework.Scenes if (satOnObject) { - SendAvatarDataToAllAgents(); +// SendAvatarDataToAllAgents(); m_requestedSitTargetID = 0; part.RemoveSittingAvatar(UUID); @@ -2719,6 +2737,22 @@ namespace OpenSim.Region.Framework.Scenes AddToPhysicalScene(false); Animator.TrySetMovementAnimation("STAND"); + + if (satOnObject) + { + ILandObject land = m_scene.LandChannel.GetLandObject(AbsolutePosition.X,AbsolutePosition.Y); + if (land != null) + { + UUID parcelID = land.LandData.GlobalID; + if (m_currentParcelUUID != parcelID) + currentParcelUUID = parcelID; + else + SendAvatarDataToAllAgents(); + } + else + SendAvatarDataToAllAgents(); + } + TriggerScenePresenceUpdated(); }