revert changes to Select/DeSelect, using the SelectObjects as control seems bad

LSLKeyTest
UbitUmarov 2016-07-14 02:11:50 +01:00
parent 445fb51455
commit aba4e2d13b
1 changed files with 18 additions and 29 deletions

View File

@ -4115,7 +4115,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if(!inview) if(!inview)
{ {
float bradius = grp.GetBoundsRadius(); // needs to be called before getBoundsCenter float bradius = grp.GetBoundsRadius();
Vector3 partpos = grp.AbsolutePosition + grp.getBoundsCenter(); Vector3 partpos = grp.AbsolutePosition + grp.getBoundsCenter();
// float dcam = (partpos - mycamera).LengthSquared(); // float dcam = (partpos - mycamera).LengthSquared();
float dpos = (partpos - mypos).LengthSquared(); float dpos = (partpos - mypos).LengthSquared();
@ -4419,7 +4419,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if(grp.IsDeleted || grp.IsAttachment) if(grp.IsDeleted || grp.IsAttachment)
continue; continue;
float bradius = grp.GetBoundsRadius(); // needs to be called before getBoundsCenter float bradius = grp.GetBoundsRadius();
Vector3 grppos = grp.AbsolutePosition + grp.getBoundsCenter(); Vector3 grppos = grp.AbsolutePosition + grp.getBoundsCenter();
// float dcam = (grppos - mycamera).LengthSquared(); // float dcam = (grppos - mycamera).LengthSquared();
float dpos = (grppos - mypos).LengthSquared(); float dpos = (grppos - mypos).LengthSquared();
@ -7688,22 +7688,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
ObjectSelect handlerObjectSelect = null; ObjectSelect handlerObjectSelect = null;
uint objID; uint objID;
lock(SelectedObjects) for (int i = 0; i < incomingselect.ObjectData.Length; i++)
{ {
for (int i = 0; i < incomingselect.ObjectData.Length; i++) objID = incomingselect.ObjectData[i].ObjectLocalID;
if (!SelectedObjects.Contains(objID))
SelectedObjects.Add(objID);
handlerObjectSelect = OnObjectSelect;
if (handlerObjectSelect != null)
{ {
objID = incomingselect.ObjectData[i].ObjectLocalID; handlerObjectSelect(objID, this);
if (!SelectedObjects.Contains(objID))
{
SelectedObjects.Add(objID);
handlerObjectSelect = OnObjectSelect;
if (handlerObjectSelect != null)
{
handlerObjectSelect(objID, this);
}
}
} }
} }
return true; return true;
@ -7724,21 +7718,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
ObjectDeselect handlerObjectDeselect = null; ObjectDeselect handlerObjectDeselect = null;
uint objID; uint objID;
lock(SelectedObjects) for (int i = 0; i < incomingdeselect.ObjectData.Length; i++)
{ {
for (int i = 0; i < incomingdeselect.ObjectData.Length; i++) objID = incomingdeselect.ObjectData[i].ObjectLocalID;
{ if (SelectedObjects.Contains(objID))
objID = incomingdeselect.ObjectData[i].ObjectLocalID; SelectedObjects.Remove(objID);
if (SelectedObjects.Contains(objID))
{
SelectedObjects.Remove(objID);
handlerObjectDeselect = OnObjectDeselect; handlerObjectDeselect = OnObjectDeselect;
if (handlerObjectDeselect != null) if (handlerObjectDeselect != null)
{ {
OnObjectDeselect(objID, this); OnObjectDeselect(objID, this);
}
}
} }
} }
return true; return true;