Add a DeleteAllSceneObjects(bool exceptNoCopy) method to allow NoCopy objects to be retained when the scene is cleared.

avinationmerge
Tom Grimshaw 2010-06-26 11:14:58 -07:00
parent 5b6485481b
commit 70d3b9aeca
1 changed files with 15 additions and 2 deletions

View File

@ -2182,6 +2182,14 @@ namespace OpenSim.Region.Framework.Scenes
/// Delete every object from the scene. This does not include attachments worn by avatars.
/// </summary>
public void DeleteAllSceneObjects()
{
DeleteAllSceneObjects(false);
}
/// <summary>
/// Delete every object from the scene. This does not include attachments worn by avatars.
/// </summary>
public void DeleteAllSceneObjects(bool exceptNoCopy)
{
lock (Entities)
{
@ -2192,12 +2200,17 @@ namespace OpenSim.Region.Framework.Scenes
if (e is SceneObjectGroup)
{
SceneObjectGroup sog = (SceneObjectGroup)e;
if (!sog.IsAttachment)
if (sog != null && !sog.IsAttachment)
{
if (!exceptNoCopy || ((sog.GetEffectivePermissions() & (uint)PermissionMask.Copy) != 0))
{
DeleteSceneObject((SceneObjectGroup)e, false);
}
}
}
}
}
}
/// <summary>
/// Synchronously delete the given object from the scene.