diff options
Correct casts so that the target id in the at_target event matches the original target id.
Fixes Mantis #2861
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 13 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 5 |
2 files changed, 10 insertions, 8 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index a88f8a9..debab8d 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -77,6 +77,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
77 | { | 77 | { |
78 | public Vector3 targetPos; | 78 | public Vector3 targetPos; |
79 | public float tolerance; | 79 | public float tolerance; |
80 | public uint handle; | ||
80 | } | 81 | } |
81 | 82 | ||
82 | public delegate void PrimCountTaintedDelegate(); | 83 | public delegate void PrimCountTaintedDelegate(); |
@@ -2891,6 +2892,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2891 | waypoint.targetPos = target; | 2892 | waypoint.targetPos = target; |
2892 | waypoint.tolerance = tolerance; | 2893 | waypoint.tolerance = tolerance; |
2893 | uint handle = m_scene.AllocateLocalId(); | 2894 | uint handle = m_scene.AllocateLocalId(); |
2895 | waypoint.handle = handle; | ||
2894 | lock (m_targets) | 2896 | lock (m_targets) |
2895 | { | 2897 | { |
2896 | m_targets.Add(handle, waypoint); | 2898 | m_targets.Add(handle, waypoint); |
@@ -2927,12 +2929,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
2927 | // trigger at_target | 2929 | // trigger at_target |
2928 | if (m_scriptListens_atTarget) | 2930 | if (m_scriptListens_atTarget) |
2929 | { | 2931 | { |
2930 | // Reusing att.tolerance to hold the index of the target in the targets dictionary | ||
2931 | // to avoid deadlocking the sim. | ||
2932 | at_target = true; | 2932 | at_target = true; |
2933 | scriptPosTarget att = new scriptPosTarget(); | 2933 | scriptPosTarget att = new scriptPosTarget(); |
2934 | att.targetPos = target.targetPos; | 2934 | att.targetPos = target.targetPos; |
2935 | att.tolerance = (float)idx; | 2935 | att.tolerance = target.tolerance; |
2936 | att.handle = target.handle; | ||
2936 | atTargets.Add(idx, att); | 2937 | atTargets.Add(idx, att); |
2937 | } | 2938 | } |
2938 | } | 2939 | } |
@@ -2956,11 +2957,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2956 | foreach (uint target in atTargets.Keys) | 2957 | foreach (uint target in atTargets.Keys) |
2957 | { | 2958 | { |
2958 | scriptPosTarget att = atTargets[target]; | 2959 | scriptPosTarget att = atTargets[target]; |
2959 | // Reusing att.tolerance to hold the index of the target in the targets dictionary | 2960 | m_scene.TriggerAtTargetEvent(localids[ctr], att.handle, att.targetPos, m_rootPart.GroupPosition); |
2960 | // to avoid deadlocking the sim. | ||
2961 | m_scene.TriggerAtTargetEvent(localids[ctr], (uint)att.tolerance, att.targetPos, m_rootPart.GroupPosition); | ||
2962 | |||
2963 | |||
2964 | } | 2961 | } |
2965 | } | 2962 | } |
2966 | return; | 2963 | return; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index e5e097b..93a6300 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 | |||
1469 | value = i; | 1469 | value = i; |
1470 | } | 1470 | } |
1471 | 1471 | ||
1472 | public LSLInteger(uint i) | ||
1473 | { | ||
1474 | value = (int)i; | ||
1475 | } | ||
1476 | |||
1472 | public LSLInteger(double d) | 1477 | public LSLInteger(double d) |
1473 | { | 1478 | { |
1474 | value = (int)d; | 1479 | value = (int)d; |