* Introduce an IsAttachment property on the group level (which just returns false if the group is already deleted)

* This is to avoid repetitive null checks - I'm beginning to think that blasting away the root part on object deletion is actually a bad move.  Perhaps we should leave it around 
and let the client ignore any superfluous packets (which it may well do anyway), since we're constantly exposing a race condition
0.6.0-stable
Justin Clarke Casey 2008-11-01 21:50:07 +00:00
parent b03e34dd2d
commit 7c04d27875
2 changed files with 21 additions and 1 deletions

View File

@ -276,7 +276,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
{
SceneObjectGroup sceneObject = (SceneObjectGroup)entity;
if (sceneObject.RootPart != null && !sceneObject.RootPart.IsAttachment)
if (!sceneObject.IsDeleted && !sceneObject.IsAttachment)
sceneObjects.Add((SceneObjectGroup)entity);
}
}

View File

@ -94,6 +94,26 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary>
public bool HasGroupChanged = false;
/// <value>
/// Is this scene object acting as an attachment?
///
/// We return false if the group has already been deleted.
///
/// TODO: At the moment set must be done on the part itself. There may be a case for doing it here since I
/// presume either all or no parts in a linkset can be part of an attachment (in which
/// case the value would get proprogated down into all the descendent parts).
/// </value>
public bool IsAttachment
{
get
{
if (!IsDeleted)
return m_rootPart.IsAttachment;
return false;
}
}
public float scriptScore = 0f;
private Vector3 lastPhysGroupPos;