aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules
diff options
context:
space:
mode:
authorAdam Frisby2007-10-20 00:09:07 +0000
committerAdam Frisby2007-10-20 00:09:07 +0000
commit5adafd538ae98073127f890d8a3db13745e6b716 (patch)
tree15b4d17d33abe3d6859c42721aff7ad77bee18b8 /OpenSim/Region/Environment/Modules
parent* IRC ChatModule extension should now be more stable. (diff)
downloadopensim-SC-5adafd538ae98073127f890d8a3db13745e6b716.zip
opensim-SC-5adafd538ae98073127f890d8a3db13745e6b716.tar.gz
opensim-SC-5adafd538ae98073127f890d8a3db13745e6b716.tar.bz2
opensim-SC-5adafd538ae98073127f890d8a3db13745e6b716.tar.xz
* Fixed an issue whereby avatar chat distances were being calculated against the region corner due to a zero vector.
* Bonus Commit: Fixed the Raster class in libTerrain.
Diffstat (limited to 'OpenSim/Region/Environment/Modules')
-rw-r--r--OpenSim/Region/Environment/Modules/ChatModule.cs12
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,