diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs index 983926f..946765a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs | |||
@@ -265,10 +265,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
265 | } | 265 | } |
266 | SceneObjectPart SensePoint = ts.host; | 266 | SceneObjectPart SensePoint = ts.host; |
267 | 267 | ||
268 | Vector3 sensorPos = SensePoint.AbsolutePosition; | 268 | Vector3 fromRegionPos = SensePoint.AbsolutePosition; |
269 | Vector3 regionPos = new Vector3(m_CmdManager.m_ScriptEngine.World.RegionInfo.RegionLocX * Constants.RegionSize, m_CmdManager.m_ScriptEngine.World.RegionInfo.RegionLocY * Constants.RegionSize, 0); | 269 | Vector3 toRegionPos; |
270 | Vector3 fromRegionPos = sensorPos + regionPos; | ||
271 | |||
272 | Quaternion q = SensePoint.RotationOffset; | 270 | Quaternion q = SensePoint.RotationOffset; |
273 | LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W); | 271 | LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W); |
274 | LSL_Types.Vector3 forward_dir = (new LSL_Types.Vector3(1, 0, 0) * r); | 272 | LSL_Types.Vector3 forward_dir = (new LSL_Types.Vector3(1, 0, 0) * r); |
@@ -290,8 +288,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
290 | 288 | ||
291 | if (!(ent is SceneObjectGroup)) // dont bother if it is a pesky avatar | 289 | if (!(ent is SceneObjectGroup)) // dont bother if it is a pesky avatar |
292 | continue; | 290 | continue; |
293 | 291 | toRegionPos = ent.AbsolutePosition; | |
294 | Vector3 toRegionPos = ent.AbsolutePosition + regionPos; | ||
295 | double dis = Math.Abs((double)Util.GetDistanceTo(toRegionPos, fromRegionPos)); | 292 | double dis = Math.Abs((double)Util.GetDistanceTo(toRegionPos, fromRegionPos)); |
296 | if (keep && dis <= ts.range && ts.host.UUID != ent.UUID) | 293 | if (keep && dis <= ts.range && ts.host.UUID != ent.UUID) |
297 | { | 294 | { |
@@ -383,9 +380,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
383 | 380 | ||
384 | SceneObjectPart SensePoint = ts.host; | 381 | SceneObjectPart SensePoint = ts.host; |
385 | 382 | ||
386 | Vector3 sensorPos = SensePoint.AbsolutePosition; | 383 | Vector3 fromRegionPos = SensePoint.AbsolutePosition; |
387 | Vector3 regionPos = new Vector3(m_CmdManager.m_ScriptEngine.World.RegionInfo.RegionLocX * Constants.RegionSize, m_CmdManager.m_ScriptEngine.World.RegionInfo.RegionLocY * Constants.RegionSize, 0); | ||
388 | Vector3 fromRegionPos = sensorPos + regionPos; | ||
389 | 384 | ||
390 | Quaternion q = SensePoint.RotationOffset; | 385 | Quaternion q = SensePoint.RotationOffset; |
391 | LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W); | 386 | LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W); |
@@ -394,6 +389,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
394 | 389 | ||
395 | bool attached = (SensePoint.AttachmentPoint != 0); | 390 | bool attached = (SensePoint.AttachmentPoint != 0); |
396 | bool nameSearch = (ts.name != null && ts.name != ""); | 391 | bool nameSearch = (ts.name != null && ts.name != ""); |
392 | Vector3 toRegionPos; | ||
397 | 393 | ||
398 | foreach (ScenePresence presence in Presences) | 394 | foreach (ScenePresence presence in Presences) |
399 | { | 395 | { |
@@ -404,8 +400,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
404 | 400 | ||
405 | if (presence.IsChildAgent) | 401 | if (presence.IsChildAgent) |
406 | keep = false; | 402 | keep = false; |
403 | toRegionPos = presence.AbsolutePosition; | ||
407 | 404 | ||
408 | Vector3 toRegionPos = presence.AbsolutePosition + regionPos; | ||
409 | double dis = Math.Abs(Util.GetDistanceTo(toRegionPos, fromRegionPos)); | 405 | double dis = Math.Abs(Util.GetDistanceTo(toRegionPos, fromRegionPos)); |
410 | 406 | ||
411 | // are they in range | 407 | // are they in range |