diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Modules/ChatModule.cs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/OpenSim/Region/Environment/Modules/ChatModule.cs b/OpenSim/Region/Environment/Modules/ChatModule.cs index a438ae6..e1a591b 100644 --- a/OpenSim/Region/Environment/Modules/ChatModule.cs +++ b/OpenSim/Region/Environment/Modules/ChatModule.cs | |||
@@ -217,7 +217,8 @@ namespace OpenSim.Region.Environment.Modules | |||
217 | 217 | ||
218 | if (avatar != null) | 218 | if (avatar != null) |
219 | { | 219 | { |
220 | fromPos = avatar.AbsolutePosition; | 220 | fromPos = avatar.AbsolutePosition; |
221 | fromRegionPos = fromPos + new LLVector3(e.Scene.RegionInfo.RegionLocX * 256, e.Scene.RegionInfo.RegionLocY * 256, 0); | ||
221 | fromName = avatar.Firstname + " " + avatar.Lastname; | 222 | fromName = avatar.Firstname + " " + avatar.Lastname; |
222 | fromAgentID = e.Sender.AgentId; | 223 | fromAgentID = e.Sender.AgentId; |
223 | avatar = null; | 224 | avatar = null; |
@@ -271,12 +272,12 @@ namespace OpenSim.Region.Environment.Modules | |||
271 | int dis = -100000; | 272 | int dis = -100000; |
272 | 273 | ||
273 | LLVector3 avatarRegionPos = presence.AbsolutePosition + new LLVector3(scene.RegionInfo.RegionLocX * 256, scene.RegionInfo.RegionLocY * 256, 0); | 274 | LLVector3 avatarRegionPos = presence.AbsolutePosition + new LLVector3(scene.RegionInfo.RegionLocX * 256, scene.RegionInfo.RegionLocY * 256, 0); |
274 | dis = (int)avatarRegionPos.GetDistanceTo(fromRegionPos); | 275 | dis = Math.Abs((int)avatarRegionPos.GetDistanceTo(fromRegionPos)); |
275 | 276 | ||
276 | switch (e.Type) | 277 | switch (e.Type) |
277 | { | 278 | { |
278 | case ChatTypeEnum.Whisper: | 279 | case ChatTypeEnum.Whisper: |
279 | if ((dis < m_whisperdistance) && (dis > -m_whisperdistance)) | 280 | if (dis < m_whisperdistance) |
280 | { | 281 | { |
281 | //should change so the message is sent through the avatar rather than direct to the ClientView | 282 | //should change so the message is sent through the avatar rather than direct to the ClientView |
282 | presence.ControllingClient.SendChatMessage(message, | 283 | presence.ControllingClient.SendChatMessage(message, |
@@ -286,8 +287,9 @@ namespace OpenSim.Region.Environment.Modules | |||
286 | fromAgentID); | 287 | fromAgentID); |
287 | } | 288 | } |
288 | break; | 289 | break; |
290 | default: | ||
289 | case ChatTypeEnum.Say: | 291 | case ChatTypeEnum.Say: |
290 | if ((dis < m_saydistance) && (dis > -m_saydistance)) | 292 | if (dis < m_saydistance) |
291 | { | 293 | { |
292 | //Console.WriteLine("sending chat"); | 294 | //Console.WriteLine("sending chat"); |
293 | presence.ControllingClient.SendChatMessage(message, | 295 | presence.ControllingClient.SendChatMessage(message, |
@@ -298,7 +300,7 @@ namespace OpenSim.Region.Environment.Modules | |||
298 | } | 300 | } |
299 | break; | 301 | break; |
300 | case ChatTypeEnum.Shout: | 302 | case ChatTypeEnum.Shout: |
301 | if ((dis < m_shoutdistance) && (dis > -m_shoutdistance)) | 303 | if (dis < m_shoutdistance) |
302 | { | 304 | { |
303 | presence.ControllingClient.SendChatMessage(message, | 305 | presence.ControllingClient.SendChatMessage(message, |
304 | type, | 306 | type, |