From 095b3e5756bb3160b30c9c5670ba008fa13d2e66 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 1 Sep 2011 01:22:28 +0100 Subject: Remove pointless cluttering SOP.ParentGroup != null checks. The only times when ParentGroup might be null is during regression tests (which might not be a valid thing) and when scene objects are being constructed from the database. At all other times it's not possible for a SOP not to have a SOG parent. --- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 29 +++++++++------------------ 1 file changed, 10 insertions(+), 19 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/SceneGraph.cs') diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 76ed55c..17a1bcc 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -1630,27 +1630,18 @@ namespace OpenSim.Region.Framework.Scenes SceneObjectGroup parentGroup = root.ParentGroup; List childGroups = new List(); - if (parentGroup != null) - { - // We do this in reverse to get the link order of the prims correct - for (int i = children.Count - 1; i >= 0; i--) - { - SceneObjectGroup child = children[i].ParentGroup; - if (child != null) - { - // Make sure no child prim is set for sale - // So that, on delink, no prims are unwittingly - // left for sale and sold off - child.RootPart.ObjectSaleType = 0; - child.RootPart.SalePrice = 10; - childGroups.Add(child); - } - } - } - else + // We do this in reverse to get the link order of the prims correct + for (int i = children.Count - 1; i >= 0; i--) { - return; // parent is null so not in this region + SceneObjectGroup child = children[i].ParentGroup; + + // Make sure no child prim is set for sale + // So that, on delink, no prims are unwittingly + // left for sale and sold off + child.RootPart.ObjectSaleType = 0; + child.RootPart.SalePrice = 10; + childGroups.Add(child); } foreach (SceneObjectGroup child in childGroups) -- cgit v1.1