Add a DeleteAllSceneObjects(bool exceptNoCopy) method to allow NoCopy objects to be retained when the scene is cleared.
parent
5b6485481b
commit
70d3b9aeca
|
@ -2182,6 +2182,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// Delete every object from the scene. This does not include attachments worn by avatars.
|
/// Delete every object from the scene. This does not include attachments worn by avatars.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void DeleteAllSceneObjects()
|
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)
|
lock (Entities)
|
||||||
{
|
{
|
||||||
|
@ -2192,8 +2200,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (e is SceneObjectGroup)
|
if (e is SceneObjectGroup)
|
||||||
{
|
{
|
||||||
SceneObjectGroup sog = (SceneObjectGroup)e;
|
SceneObjectGroup sog = (SceneObjectGroup)e;
|
||||||
if (!sog.IsAttachment)
|
if (sog != null && !sog.IsAttachment)
|
||||||
DeleteSceneObject((SceneObjectGroup)e, false);
|
{
|
||||||
|
if (!exceptNoCopy || ((sog.GetEffectivePermissions() & (uint)PermissionMask.Copy) != 0))
|
||||||
|
{
|
||||||
|
DeleteSceneObject((SceneObjectGroup)e, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue