diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Chat')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs index 174642d..917f164 100644 --- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs | |||
@@ -372,21 +372,24 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
372 | UUID fromAgentID, UUID ownerID, string fromName, ChatTypeEnum type, | 372 | UUID fromAgentID, UUID ownerID, string fromName, ChatTypeEnum type, |
373 | string message, ChatSourceType src, bool ignoreDistance) | 373 | string message, ChatSourceType src, bool ignoreDistance) |
374 | { | 374 | { |
375 | // don't send chat to child agents | 375 | if (presence.LifecycleState != ScenePresenceState.Running) |
376 | if (presence.IsChildAgent) return false; | 376 | return false; |
377 | |||
378 | Vector3 fromRegionPos = fromPos + regionPos; | ||
379 | Vector3 toRegionPos = presence.AbsolutePosition + | ||
380 | new Vector3(presence.Scene.RegionInfo.RegionLocX * Constants.RegionSize, | ||
381 | presence.Scene.RegionInfo.RegionLocY * Constants.RegionSize, 0); | ||
382 | 377 | ||
383 | int dis = (int)Util.GetDistanceTo(toRegionPos, fromRegionPos); | 378 | if (!ignoreDistance) |
384 | |||
385 | if (type == ChatTypeEnum.Whisper && dis > m_whisperdistance || | ||
386 | type == ChatTypeEnum.Say && dis > m_saydistance || | ||
387 | type == ChatTypeEnum.Shout && dis > m_shoutdistance) | ||
388 | { | 379 | { |
389 | return false; | 380 | Vector3 fromRegionPos = fromPos + regionPos; |
381 | Vector3 toRegionPos = presence.AbsolutePosition + | ||
382 | new Vector3(presence.Scene.RegionInfo.RegionLocX * Constants.RegionSize, | ||
383 | presence.Scene.RegionInfo.RegionLocY * Constants.RegionSize, 0); | ||
384 | |||
385 | int dis = (int)Util.GetDistanceTo(toRegionPos, fromRegionPos); | ||
386 | |||
387 | if (type == ChatTypeEnum.Whisper && dis > m_whisperdistance || | ||
388 | type == ChatTypeEnum.Say && dis > m_saydistance || | ||
389 | type == ChatTypeEnum.Shout && dis > m_shoutdistance) | ||
390 | { | ||
391 | return false; | ||
392 | } | ||
390 | } | 393 | } |
391 | 394 | ||
392 | // TODO: should change so the message is sent through the avatar rather than direct to the ClientView | 395 | // TODO: should change so the message is sent through the avatar rather than direct to the ClientView |