Merge branch 'master' of /var/git/opensim/

viewer-2-initial-appearance
opensim mirror account 2010-11-07 19:50:07 -08:00
commit 4ff3be90e0
3 changed files with 46 additions and 4 deletions

View File

@ -178,13 +178,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
UUID itemID = UUID.Zero; UUID itemID = UUID.Zero;
if (sp != null) if (sp != null)
{ {
foreach (SceneObjectGroup grp in sp.GetAttachments(AttachmentPt)) foreach(SceneObjectGroup grp in sp.Attachments)
{
if (grp.GetAttachmentPoint() == (byte)AttachmentPt)
{ {
itemID = grp.GetFromItemID(); itemID = grp.GetFromItemID();
break;
}
}
if (itemID != UUID.Zero) if (itemID != UUID.Zero)
DetachSingleAttachmentToInv(itemID, remoteClient); DetachSingleAttachmentToInv(itemID, remoteClient);
} }
}
if (group.GetFromItemID() == UUID.Zero) if (group.GetFromItemID() == UUID.Zero)
{ {

View File

@ -459,6 +459,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
// Now let's make it officially a child agent // Now let's make it officially a child agent
sp.MakeChildAgent(); sp.MakeChildAgent();
sp.Scene.CleanDroppedAttachments();
// Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone
if (NeedsClosing(oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) if (NeedsClosing(oldRegionX, newRegionX, oldRegionY, newRegionY, reg))

View File

@ -3162,6 +3162,9 @@ namespace OpenSim.Region.Framework.Scenes
} }
m_eventManager.TriggerOnRemovePresence(agentID); m_eventManager.TriggerOnRemovePresence(agentID);
CleanDroppedAttachments();
ForEachClient( ForEachClient(
delegate(IClientAPI client) delegate(IClientAPI client)
{ {
@ -3408,6 +3411,8 @@ namespace OpenSim.Region.Framework.Scenes
if (vialogin) if (vialogin)
{ {
CleanDroppedAttachments();
if (TestBorderCross(agent.startpos, Cardinals.E)) if (TestBorderCross(agent.startpos, Cardinals.E))
{ {
Border crossedBorder = GetCrossedBorder(agent.startpos, Cardinals.E); Border crossedBorder = GetCrossedBorder(agent.startpos, Cardinals.E);
@ -4984,5 +4989,36 @@ namespace OpenSim.Region.Framework.Scenes
throw new Exception(error); throw new Exception(error);
} }
} }
public void CleanDroppedAttachments()
{
List<SceneObjectGroup> objectsToDelete =
new List<SceneObjectGroup>();
ForEachSOG(delegate (SceneObjectGroup grp)
{
if (grp.RootPart.Shape.State != 0)
{
if (grp.RootPart.Shape.PCode == 0 && grp.RootPart.Shape.State != 0 && (!objectsToDelete.Contains(grp)))
{
objectsToDelete.Add(grp);
return;
}
ScenePresence sp = GetScenePresence(agentID);
if (sp == null)
{
objectsToDelete.Add(grp);
return;
}
}
});
foreach (SceneObjectGroup grp in objectsToDelete)
{
m_log.InfoFormat("[SCENE]: Deleting dropped attachment {0} of user {1}", grp.UUID, grp.OwnerID);
DeleteSceneObject(grp, true);
}
}
} }
} }