Correct casts so that the target id in the at_target event matches the original target id.
Fixes Mantis #28610.6.4-rc1
parent
5a49c772ca
commit
1fd57b39df
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue