From 598316c89051e8e8d6633520da63a7d44fd80bbd Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 17 Nov 2008 05:57:58 +0000 Subject: Make object chat come from the root prim's center, rather than trying to make it come from a child prim position. --- OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 15 ++++++--------- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 6 +++--- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 4148f9b..a02840c 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -424,17 +424,14 @@ namespace OpenSim.Region.Environment.Scenes m_groupPosition.Y = PhysActor.Position.Y; m_groupPosition.Z = PhysActor.Position.Z; } + if (IsAttachment) { -// if (m_parentGroup != null && m_parentGroup.RootPart != null) -// { -// ScenePresence sp = m_parentGroup.Scene.GetScenePresence(m_parentGroup.RootPart.AttachedAvatar); - ScenePresence sp = m_parentGroup.Scene.GetScenePresence(AttachedAvatar); - if (sp != null) - { - return sp.AbsolutePosition; - } -// } + ScenePresence sp = m_parentGroup.Scene.GetScenePresence(AttachedAvatar); + if (sp != null) + { + return sp.AbsolutePosition; + } } return m_groupPosition; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 2408a5e..b189ffd 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -672,7 +672,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api text = text.Substring(0, 1023); World.SimChat(Utils.StringToBytes(text), - ChatTypeEnum.Whisper, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID, false); + ChatTypeEnum.Whisper, channelID, m_host.ParentGroup.RootPart.AbsolutePosition, m_host.Name, m_host.UUID, false); IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface(); wComm.DeliverMessage(ChatTypeEnum.Whisper, channelID, m_host.Name, m_host.UUID, text); @@ -686,7 +686,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api text = text.Substring(0, 1023); World.SimChat(Utils.StringToBytes(text), - ChatTypeEnum.Say, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID, false); + ChatTypeEnum.Say, channelID, m_host.ParentGroup.RootPart.AbsolutePosition, m_host.Name, m_host.UUID, false); IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface(); wComm.DeliverMessage(ChatTypeEnum.Say, channelID, m_host.Name, m_host.UUID, text); @@ -700,7 +700,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api text = text.Substring(0, 1023); World.SimChat(Utils.StringToBytes(text), - ChatTypeEnum.Shout, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID, true); + ChatTypeEnum.Shout, channelID, m_host.ParentGroup.RootPart.AbsolutePosition, m_host.Name, m_host.UUID, true); IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface(); wComm.DeliverMessage(ChatTypeEnum.Shout, channelID, m_host.Name, m_host.UUID, text); -- cgit v1.1