Change the deselect processing to prevent gratuituous full update
when an attachment is deselected.0.6.0-stable
parent
c200644bd9
commit
35dde94f01
|
@ -147,25 +147,53 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <param name="remoteClient"></param>
|
/// <param name="remoteClient"></param>
|
||||||
public void DeselectPrim(uint primLocalID, IClientAPI remoteClient)
|
public void DeselectPrim(uint primLocalID, IClientAPI remoteClient)
|
||||||
{
|
{
|
||||||
List<EntityBase> EntityList = GetEntities();
|
SceneObjectPart part = GetSceneObjectPart(primLocalID);
|
||||||
|
if(part == null)
|
||||||
|
return;
|
||||||
|
|
||||||
foreach (EntityBase ent in EntityList)
|
bool isAttachment = false;
|
||||||
|
|
||||||
|
// If the parent group is null, we are in an inconsistent state
|
||||||
|
// try to recover gracefully by doing all that can be done on
|
||||||
|
// a lone prim
|
||||||
|
//
|
||||||
|
if (part.ParentGroup == null)
|
||||||
{
|
{
|
||||||
if (ent is SceneObjectGroup)
|
if(part.IsAttachment)
|
||||||
|
isAttachment = true;
|
||||||
|
else
|
||||||
|
part.ScheduleFullUpdate();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
part.ParentGroup.IsSelected = false;
|
||||||
|
|
||||||
|
// This is wrong, wrong, wrong. Selection should not be
|
||||||
|
// handled by group, but by prim. Legacy cruft.
|
||||||
|
// TODO: Make selection flagging per prim!
|
||||||
|
//
|
||||||
|
if (part.ParentGroup.RootPart != null)
|
||||||
{
|
{
|
||||||
if (((SceneObjectGroup) ent).LocalId == primLocalID)
|
if (part.ParentGroup.RootPart.IsAttachment)
|
||||||
{
|
isAttachment = true;
|
||||||
((SceneObjectGroup) ent).IsSelected = false;
|
else
|
||||||
((SceneObjectGroup)ent).ScheduleGroupForFullUpdate();
|
part.ParentGroup.ScheduleGroupForFullUpdate();
|
||||||
if (ExternalChecks.ExternalChecksCanEditObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId)
|
|
||||||
|| ExternalChecks.ExternalChecksCanMoveObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId))
|
|
||||||
{
|
|
||||||
EventManager.TriggerParcelPrimCountTainted();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If it's not an attachment, and we are allowed to move it,
|
||||||
|
// then we might have done so. If we moved across a parcel
|
||||||
|
// boundary, we will need to recount prims on the parcels.
|
||||||
|
// For attachments, that makes no sense.
|
||||||
|
//
|
||||||
|
if (!isAttachment)
|
||||||
|
{
|
||||||
|
if (ExternalChecks.ExternalChecksCanEditObject(
|
||||||
|
part.UUID, remoteClient.AgentId)
|
||||||
|
|| ExternalChecks.ExternalChecksCanMoveObject(
|
||||||
|
part.UUID, remoteClient.AgentId))
|
||||||
|
EventManager.TriggerParcelPrimCountTainted();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void ProcessMoneyTransferRequest(LLUUID source, LLUUID destination, int amount,
|
public virtual void ProcessMoneyTransferRequest(LLUUID source, LLUUID destination, int amount,
|
||||||
|
|
Loading…
Reference in New Issue