diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs index 58f747b..5229c08 100644 --- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs | |||
@@ -326,15 +326,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat | |||
326 | UUID fromAgentID, UUID ownerID, string fromName, ChatTypeEnum type, | 326 | UUID fromAgentID, UUID ownerID, string fromName, ChatTypeEnum type, |
327 | string message, ChatSourceType src, bool ignoreDistance) | 327 | string message, ChatSourceType src, bool ignoreDistance) |
328 | { | 328 | { |
329 | Vector3 fromRegionPos = fromPos + regionPos; | 329 | if (presence.LifecycleState != ScenePresenceState.Running) |
330 | Vector3 toRegionPos = presence.AbsolutePosition + | 330 | return false; |
331 | new Vector3(presence.Scene.RegionInfo.RegionLocX * Constants.RegionSize, | ||
332 | presence.Scene.RegionInfo.RegionLocY * Constants.RegionSize, 0); | ||
333 | |||
334 | int dis = (int)Util.GetDistanceTo(toRegionPos, fromRegionPos); | ||
335 | 331 | ||
336 | if (!ignoreDistance) | 332 | if (!ignoreDistance) |
337 | { | 333 | { |
334 | Vector3 fromRegionPos = fromPos + regionPos; | ||
335 | Vector3 toRegionPos = presence.AbsolutePosition + | ||
336 | new Vector3(presence.Scene.RegionInfo.RegionLocX * Constants.RegionSize, | ||
337 | presence.Scene.RegionInfo.RegionLocY * Constants.RegionSize, 0); | ||
338 | |||
339 | int dis = (int)Util.GetDistanceTo(toRegionPos, fromRegionPos); | ||
340 | |||
338 | if (type == ChatTypeEnum.Whisper && dis > m_whisperdistance || | 341 | if (type == ChatTypeEnum.Whisper && dis > m_whisperdistance || |
339 | type == ChatTypeEnum.Say && dis > m_saydistance || | 342 | type == ChatTypeEnum.Say && dis > m_saydistance || |
340 | type == ChatTypeEnum.Shout && dis > m_shoutdistance) | 343 | type == ChatTypeEnum.Shout && dis > m_shoutdistance) |