Change the deselect processing to prevent gratuituous full update

when an attachment is deselected.
0.6.0-stable
Melanie Thielker 2008-08-17 22:38:52 +00:00
parent c200644bd9
commit 35dde94f01
1 changed files with 42 additions and 14 deletions

View File

@ -147,24 +147,52 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="remoteClient"></param>
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
{
if (((SceneObjectGroup) ent).LocalId == primLocalID)
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)
{
((SceneObjectGroup) ent).IsSelected = false;
((SceneObjectGroup)ent).ScheduleGroupForFullUpdate();
if (ExternalChecks.ExternalChecksCanEditObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId)
|| ExternalChecks.ExternalChecksCanMoveObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId))
if (part.ParentGroup.RootPart.IsAttachment)
isAttachment = true;
else
part.ParentGroup.ScheduleGroupForFullUpdate();
}
}
// 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();
break;
}
}
}
}
}