diff options
3 files changed, 46 insertions, 4 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index e89368a..9c1154b 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -178,12 +178,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
178 | UUID itemID = UUID.Zero; | 178 | UUID itemID = UUID.Zero; |
179 | if (sp != null) | 179 | if (sp != null) |
180 | { | 180 | { |
181 | foreach (SceneObjectGroup grp in sp.GetAttachments(AttachmentPt)) | 181 | foreach(SceneObjectGroup grp in sp.Attachments) |
182 | { | 182 | { |
183 | itemID = grp.GetFromItemID(); | 183 | if (grp.GetAttachmentPoint() == (byte)AttachmentPt) |
184 | if (itemID != UUID.Zero) | 184 | { |
185 | DetachSingleAttachmentToInv(itemID, remoteClient); | 185 | itemID = grp.GetFromItemID(); |
186 | break; | ||
187 | } | ||
186 | } | 188 | } |
189 | if (itemID != UUID.Zero) | ||
190 | DetachSingleAttachmentToInv(itemID, remoteClient); | ||
187 | } | 191 | } |
188 | 192 | ||
189 | if (group.GetFromItemID() == UUID.Zero) | 193 | if (group.GetFromItemID() == UUID.Zero) |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 485e05a..b5cab84 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -459,6 +459,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
459 | // Now let's make it officially a child agent | 459 | // Now let's make it officially a child agent |
460 | sp.MakeChildAgent(); | 460 | sp.MakeChildAgent(); |
461 | 461 | ||
462 | sp.Scene.CleanDroppedAttachments(); | ||
463 | |||
462 | // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone | 464 | // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone |
463 | 465 | ||
464 | if (NeedsClosing(oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) | 466 | if (NeedsClosing(oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 3343d08..3576a88 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -3162,6 +3162,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
3162 | } | 3162 | } |
3163 | 3163 | ||
3164 | m_eventManager.TriggerOnRemovePresence(agentID); | 3164 | m_eventManager.TriggerOnRemovePresence(agentID); |
3165 | |||
3166 | CleanDroppedAttachments(); | ||
3167 | |||
3165 | ForEachClient( | 3168 | ForEachClient( |
3166 | delegate(IClientAPI client) | 3169 | delegate(IClientAPI client) |
3167 | { | 3170 | { |
@@ -3408,6 +3411,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3408 | 3411 | ||
3409 | if (vialogin) | 3412 | if (vialogin) |
3410 | { | 3413 | { |
3414 | CleanDroppedAttachments(); | ||
3415 | |||
3411 | if (TestBorderCross(agent.startpos, Cardinals.E)) | 3416 | if (TestBorderCross(agent.startpos, Cardinals.E)) |
3412 | { | 3417 | { |
3413 | Border crossedBorder = GetCrossedBorder(agent.startpos, Cardinals.E); | 3418 | Border crossedBorder = GetCrossedBorder(agent.startpos, Cardinals.E); |
@@ -4984,5 +4989,36 @@ namespace OpenSim.Region.Framework.Scenes | |||
4984 | throw new Exception(error); | 4989 | throw new Exception(error); |
4985 | } | 4990 | } |
4986 | } | 4991 | } |
4992 | |||
4993 | public void CleanDroppedAttachments() | ||
4994 | { | ||
4995 | List<SceneObjectGroup> objectsToDelete = | ||
4996 | new List<SceneObjectGroup>(); | ||
4997 | |||
4998 | ForEachSOG(delegate (SceneObjectGroup grp) | ||
4999 | { | ||
5000 | if (grp.RootPart.Shape.State != 0) | ||
5001 | { | ||
5002 | if (grp.RootPart.Shape.PCode == 0 && grp.RootPart.Shape.State != 0 && (!objectsToDelete.Contains(grp))) | ||
5003 | { | ||
5004 | objectsToDelete.Add(grp); | ||
5005 | return; | ||
5006 | } | ||
5007 | |||
5008 | ScenePresence sp = GetScenePresence(agentID); | ||
5009 | if (sp == null) | ||
5010 | { | ||
5011 | objectsToDelete.Add(grp); | ||
5012 | return; | ||
5013 | } | ||
5014 | } | ||
5015 | }); | ||
5016 | |||
5017 | foreach (SceneObjectGroup grp in objectsToDelete) | ||
5018 | { | ||
5019 | m_log.InfoFormat("[SCENE]: Deleting dropped attachment {0} of user {1}", grp.UUID, grp.OwnerID); | ||
5020 | DeleteSceneObject(grp, true); | ||
5021 | } | ||
5022 | } | ||
4987 | } | 5023 | } |
4988 | } | 5024 | } |