mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 08:06:27 +08:00
Use SP.ParentPart instead of ParentID in places where it's more efficient (saving extra null checks, etc.)
However, it looks like we should retain SP.ParentID since it's much easier to use that in places where another thread could change ParentPart to null. Otherwise one has to clumsily put ParentPart in a reference, etc. to avoid a race.
This commit is contained in:
@@ -716,29 +716,17 @@ namespace OpenSim.Region.RegionCombinerModule
|
||||
{
|
||||
if (sp.UUID != presence.UUID)
|
||||
{
|
||||
if (sp.ParentID != 0)
|
||||
{
|
||||
// sitting avatar
|
||||
SceneObjectPart sop = connectiondata.RegionScene.GetSceneObjectPart(sp.ParentID);
|
||||
if (sop != null)
|
||||
{
|
||||
CoarseLocations.Add(sop.AbsolutePosition + sp.AbsolutePosition);
|
||||
AvatarUUIDs.Add(sp.UUID);
|
||||
}
|
||||
else
|
||||
{
|
||||
// we can't find the parent.. ! arg!
|
||||
CoarseLocations.Add(sp.AbsolutePosition);
|
||||
AvatarUUIDs.Add(sp.UUID);
|
||||
}
|
||||
}
|
||||
SceneObjectPart sitPart = sp.ParentPart;
|
||||
|
||||
if (sitPart != null)
|
||||
CoarseLocations.Add(sitPart.AbsolutePosition + sp.AbsolutePosition);
|
||||
else
|
||||
{
|
||||
CoarseLocations.Add(sp.AbsolutePosition);
|
||||
AvatarUUIDs.Add(sp.UUID);
|
||||
}
|
||||
|
||||
AvatarUUIDs.Add(sp.UUID);
|
||||
}
|
||||
});
|
||||
|
||||
DistributeCourseLocationUpdates(CoarseLocations, AvatarUUIDs, connectiondata, presence);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user