aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-03-09 02:38:11 +0000
committerJustin Clark-Casey (justincc)2012-03-09 02:38:11 +0000
commit94e58ff6b9368975925cea4697077a8e59162bc0 (patch)
tree1798f25a23316e71182aca5634fcd5eebb4133bf /OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs
parentrefactor: cleanup SP.HandleAgentSit so that everything is done within one if ... (diff)
downloadopensim-SC_OLD-94e58ff6b9368975925cea4697077a8e59162bc0.zip
opensim-SC_OLD-94e58ff6b9368975925cea4697077a8e59162bc0.tar.gz
opensim-SC_OLD-94e58ff6b9368975925cea4697077a8e59162bc0.tar.bz2
opensim-SC_OLD-94e58ff6b9368975925cea4697077a8e59162bc0.tar.xz
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.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs26
1 files changed, 7 insertions, 19 deletions
diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs
index 09da97a..a2e3ac2 100644
--- a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs
+++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs
@@ -716,29 +716,17 @@ namespace OpenSim.Region.RegionCombinerModule
716 { 716 {
717 if (sp.UUID != presence.UUID) 717 if (sp.UUID != presence.UUID)
718 { 718 {
719 if (sp.ParentID != 0) 719 SceneObjectPart sitPart = sp.ParentPart;
720 { 720
721 // sitting avatar 721 if (sitPart != null)
722 SceneObjectPart sop = connectiondata.RegionScene.GetSceneObjectPart(sp.ParentID); 722 CoarseLocations.Add(sitPart.AbsolutePosition + sp.AbsolutePosition);
723 if (sop != null)
724 {
725 CoarseLocations.Add(sop.AbsolutePosition + sp.AbsolutePosition);
726 AvatarUUIDs.Add(sp.UUID);
727 }
728 else
729 {
730 // we can't find the parent.. ! arg!
731 CoarseLocations.Add(sp.AbsolutePosition);
732 AvatarUUIDs.Add(sp.UUID);
733 }
734 }
735 else 723 else
736 {
737 CoarseLocations.Add(sp.AbsolutePosition); 724 CoarseLocations.Add(sp.AbsolutePosition);
738 AvatarUUIDs.Add(sp.UUID); 725
739 } 726 AvatarUUIDs.Add(sp.UUID);
740 } 727 }
741 }); 728 });
729
742 DistributeCourseLocationUpdates(CoarseLocations, AvatarUUIDs, connectiondata, presence); 730 DistributeCourseLocationUpdates(CoarseLocations, AvatarUUIDs, connectiondata, presence);
743 } 731 }
744 732