aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs11
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 4d8fb90..357c2af 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 {
@@ -346,8 +352,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
346 UUID fromAgentID, string fromName, ChatTypeEnum type, 352 UUID fromAgentID, string fromName, ChatTypeEnum type,
347 string message, ChatSourceType src) 353 string message, ChatSourceType src)
348 { 354 {
349 // don't send stuff to child agents 355 // don't send llRegionSay to child agents. Send normal chat because you
350 if (presence.IsChildAgent) return false; 356 // can't talk across sim borders if it's not done
357 if (type == ChatTypeEnum.Broadcast && presence.IsChildAgent) return false;
351 358
352 Vector3 fromRegionPos = fromPos + regionPos; 359 Vector3 fromRegionPos = fromPos + regionPos;
353 Vector3 toRegionPos = presence.AbsolutePosition + 360 Vector3 toRegionPos = presence.AbsolutePosition +