diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs index 5649855..bc42fd1 100644 --- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs | |||
@@ -199,6 +199,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
199 | UUID fromID = UUID.Zero; | 199 | UUID fromID = UUID.Zero; |
200 | string message = c.Message; | 200 | string message = c.Message; |
201 | IScene scene = c.Scene; | 201 | IScene scene = c.Scene; |
202 | UUID destination = c.Destination; | ||
202 | Vector3 fromPos = c.Position; | 203 | Vector3 fromPos = c.Position; |
203 | Vector3 regionPos = new Vector3(scene.RegionInfo.RegionLocX * Constants.RegionSize, | 204 | Vector3 regionPos = new Vector3(scene.RegionInfo.RegionLocX * Constants.RegionSize, |
204 | scene.RegionInfo.RegionLocY * Constants.RegionSize, 0); | 205 | scene.RegionInfo.RegionLocY * Constants.RegionSize, 0); |
@@ -222,6 +223,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
222 | { | 223 | { |
223 | fromNamePrefix = m_adminPrefix; | 224 | fromNamePrefix = m_adminPrefix; |
224 | } | 225 | } |
226 | destination = UUID.Zero; // Avatars cant "SayTo" | ||
225 | break; | 227 | break; |
226 | 228 | ||
227 | case ChatSourceType.Object: | 229 | case ChatSourceType.Object: |
@@ -244,9 +246,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
244 | { | 246 | { |
245 | // This should use ForEachClient, but clients don't have a position. | 247 | // This should use ForEachClient, but clients don't have a position. |
246 | // If camera is moved into client, then camera position can be used | 248 | // If camera is moved into client, then camera position can be used |
249 | // MT: No, it can't, as chat is heard from the avatar position, not | ||
250 | // the camera position. | ||
247 | s.ForEachRootScenePresence( | 251 | s.ForEachRootScenePresence( |
248 | delegate(ScenePresence presence) | 252 | delegate(ScenePresence presence) |
249 | { | 253 | { |
254 | if (destination != UUID.Zero && presence.UUID != destination) | ||
255 | return; | ||
250 | ILandObject Presencecheck = s.LandChannel.GetLandObject(presence.AbsolutePosition.X, presence.AbsolutePosition.Y); | 256 | ILandObject Presencecheck = s.LandChannel.GetLandObject(presence.AbsolutePosition.X, presence.AbsolutePosition.Y); |
251 | if (Presencecheck != null) | 257 | if (Presencecheck != null) |
252 | { | 258 | { |
@@ -345,8 +351,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
345 | UUID fromAgentID, string fromName, ChatTypeEnum type, | 351 | UUID fromAgentID, string fromName, ChatTypeEnum type, |
346 | string message, ChatSourceType src) | 352 | string message, ChatSourceType src) |
347 | { | 353 | { |
348 | // don't send stuff to child agents | 354 | // don't send llRegionSay to child agents. Send normal chat because you |
349 | if (presence.IsChildAgent) return false; | 355 | // can't talk across sim borders if it's not done |
356 | if (type == ChatTypeEnum.Broadcast && presence.IsChildAgent) return false; | ||
350 | 357 | ||
351 | Vector3 fromRegionPos = fromPos + regionPos; | 358 | Vector3 fromRegionPos = fromPos + regionPos; |
352 | Vector3 toRegionPos = presence.AbsolutePosition + | 359 | Vector3 toRegionPos = presence.AbsolutePosition + |