diff options
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 37 |
2 files changed, 39 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 0ba67d3..ee07f30 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -446,6 +446,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
446 | // Now let's make it officially a child agent | 446 | // Now let's make it officially a child agent |
447 | sp.MakeChildAgent(); | 447 | sp.MakeChildAgent(); |
448 | 448 | ||
449 | sp.Scene.CleanDroppedAttachments(); | ||
450 | |||
449 | // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone | 451 | // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone |
450 | 452 | ||
451 | if (NeedsClosing(oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) | 453 | if (NeedsClosing(oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 957c4e8..37d797e 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -3209,6 +3209,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
3209 | m_log.Debug("[Scene] Beginning OnRemovePresence"); | 3209 | m_log.Debug("[Scene] Beginning OnRemovePresence"); |
3210 | m_eventManager.TriggerOnRemovePresence(agentID); | 3210 | m_eventManager.TriggerOnRemovePresence(agentID); |
3211 | m_log.Debug("[Scene] Finished OnRemovePresence"); | 3211 | m_log.Debug("[Scene] Finished OnRemovePresence"); |
3212 | |||
3213 | CleanDroppedAttachments(); | ||
3214 | |||
3212 | ForEachClient( | 3215 | ForEachClient( |
3213 | delegate(IClientAPI client) | 3216 | delegate(IClientAPI client) |
3214 | { | 3217 | { |
@@ -3442,6 +3445,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3442 | 3445 | ||
3443 | if (vialogin) | 3446 | if (vialogin) |
3444 | { | 3447 | { |
3448 | CleanDroppedAttachments(); | ||
3449 | |||
3445 | if (TestBorderCross(agent.startpos, Cardinals.E)) | 3450 | if (TestBorderCross(agent.startpos, Cardinals.E)) |
3446 | { | 3451 | { |
3447 | Border crossedBorder = GetCrossedBorder(agent.startpos, Cardinals.E); | 3452 | Border crossedBorder = GetCrossedBorder(agent.startpos, Cardinals.E); |
@@ -5040,5 +5045,37 @@ namespace OpenSim.Region.Framework.Scenes | |||
5040 | throw new Exception(error); | 5045 | throw new Exception(error); |
5041 | } | 5046 | } |
5042 | } | 5047 | } |
5048 | |||
5049 | public void CleanDroppedAttachments() | ||
5050 | { | ||
5051 | List<SceneObjectGroup> objectsToDelete = | ||
5052 | new List<SceneObjectGroup>(); | ||
5053 | |||
5054 | ForEachSOG(delegate (SceneObjectGroup grp) | ||
5055 | { | ||
5056 | if (grp.RootPart.Shape.State != 0) | ||
5057 | { | ||
5058 | UUID agentID = grp.OwnerID; | ||
5059 | if (agentID == UUID.Zero) | ||
5060 | { | ||
5061 | objectsToDelete.Add(grp); | ||
5062 | return; | ||
5063 | } | ||
5064 | |||
5065 | ScenePresence sp = GetScenePresence(agentID); | ||
5066 | if (sp == null) | ||
5067 | { | ||
5068 | objectsToDelete.Add(grp); | ||
5069 | return; | ||
5070 | } | ||
5071 | } | ||
5072 | }); | ||
5073 | |||
5074 | foreach (SceneObjectGroup grp in objectsToDelete) | ||
5075 | { | ||
5076 | m_log.InfoFormat("[SCENE]: Deleting dropped attachment {0} of user {1}", grp.UUID, grp.OwnerID); | ||
5077 | DeleteSceneObject(grp, true); | ||
5078 | } | ||
5079 | } | ||
5043 | } | 5080 | } |
5044 | } | 5081 | } |