diff options
author | Melanie | 2013-09-07 13:54:19 +0100 |
---|---|---|
committer | Melanie | 2013-09-07 13:54:19 +0100 |
commit | 2f365ea80be0df545a74da03afceb964da1546d1 (patch) | |
tree | a54202b1cdabaa201c0566232bde69cecdcfef6a /OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs | |
parent | Merge branch 'master' into careminster (diff) | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC-2f365ea80be0df545a74da03afceb964da1546d1.zip opensim-SC-2f365ea80be0df545a74da03afceb964da1546d1.tar.gz opensim-SC-2f365ea80be0df545a74da03afceb964da1546d1.tar.bz2 opensim-SC-2f365ea80be0df545a74da03afceb964da1546d1.tar.xz |
Merge branch 'master' into careminster
Conflicts:
OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
OpenSim/Region/Framework/Scenes/Scene.cs
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs')
-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 |