diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index a88f8a9bfa..debab8d7ed 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -77,6 +77,7 @@ namespace OpenSim.Region.Framework.Scenes { public Vector3 targetPos; public float tolerance; + public uint handle; } public delegate void PrimCountTaintedDelegate(); @@ -2891,6 +2892,7 @@ namespace OpenSim.Region.Framework.Scenes waypoint.targetPos = target; waypoint.tolerance = tolerance; uint handle = m_scene.AllocateLocalId(); + waypoint.handle = handle; lock (m_targets) { m_targets.Add(handle, waypoint); @@ -2927,12 +2929,11 @@ namespace OpenSim.Region.Framework.Scenes // trigger at_target if (m_scriptListens_atTarget) { - // Reusing att.tolerance to hold the index of the target in the targets dictionary - // to avoid deadlocking the sim. at_target = true; scriptPosTarget att = new scriptPosTarget(); att.targetPos = target.targetPos; - att.tolerance = (float)idx; + att.tolerance = target.tolerance; + att.handle = target.handle; atTargets.Add(idx, att); } } @@ -2956,11 +2957,7 @@ namespace OpenSim.Region.Framework.Scenes foreach (uint target in atTargets.Keys) { scriptPosTarget att = atTargets[target]; - // Reusing att.tolerance to hold the index of the target in the targets dictionary - // to avoid deadlocking the sim. - m_scene.TriggerAtTargetEvent(localids[ctr], (uint)att.tolerance, att.targetPos, m_rootPart.GroupPosition); - - + m_scene.TriggerAtTargetEvent(localids[ctr], att.handle, att.targetPos, m_rootPart.GroupPosition); } } return; diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index e5e097bbcd..93a630056a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs @@ -1469,6 +1469,11 @@ namespace OpenSim.Region.ScriptEngine.Shared value = i; } + public LSLInteger(uint i) + { + value = (int)i; + } + public LSLInteger(double d) { value = (int)d;