diff options
author | opensim mirror account | 2010-11-07 19:50:07 -0800 |
---|---|---|
committer | opensim mirror account | 2010-11-07 19:50:07 -0800 |
commit | 4ff3be90e045b358411e6764cc83ceb986797717 (patch) | |
tree | 596de3fc4707dddf5dbeb2f5044d4e71e170bab1 /OpenSim/Region/Framework/Scenes/Scene.cs | |
parent | Merge branch 'master' of /var/git/opensim/ (diff) | |
parent | Prevent plants from being treated like dropped attachments and removed (diff) | |
download | opensim-SC-4ff3be90e045b358411e6764cc83ceb986797717.zip opensim-SC-4ff3be90e045b358411e6764cc83ceb986797717.tar.gz opensim-SC-4ff3be90e045b358411e6764cc83ceb986797717.tar.bz2 opensim-SC-4ff3be90e045b358411e6764cc83ceb986797717.tar.xz |
Merge branch 'master' of /var/git/opensim/
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 36 |
1 files changed, 36 insertions, 0 deletions
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 | } |