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. --- .../World/Estate/EstateManagementModule.cs | 50 ++++++++++------------ .../World/Objects/BuySell/BuySellModule.cs | 5 +-- .../World/Permissions/PermissionsModule.cs | 2 +- 3 files changed, 24 insertions(+), 33 deletions(-) (limited to 'OpenSim/Region/CoreModules/World') diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 3aed6ba..d0605e3 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs @@ -851,41 +851,35 @@ namespace OpenSim.Region.CoreModules.World.Estate SceneObjectPart prt = Scene.GetSceneObjectPart(obj); if (prt != null) { - if (prt.ParentGroup != null) + SceneObjectGroup sog = prt.ParentGroup; + LandStatReportItem lsri = new LandStatReportItem(); + lsri.LocationX = sog.AbsolutePosition.X; + lsri.LocationY = sog.AbsolutePosition.Y; + lsri.LocationZ = sog.AbsolutePosition.Z; + lsri.Score = SceneData[obj]; + lsri.TaskID = sog.UUID; + lsri.TaskLocalID = sog.LocalId; + lsri.TaskName = sog.GetPartName(obj); + lsri.OwnerName = "waiting"; + lock (uuidNameLookupList) + uuidNameLookupList.Add(sog.OwnerID); + + if (filter.Length != 0) { - SceneObjectGroup sog = prt.ParentGroup; - if (sog != null) + if ((lsri.OwnerName.Contains(filter) || lsri.TaskName.Contains(filter))) { - LandStatReportItem lsri = new LandStatReportItem(); - lsri.LocationX = sog.AbsolutePosition.X; - lsri.LocationY = sog.AbsolutePosition.Y; - lsri.LocationZ = sog.AbsolutePosition.Z; - lsri.Score = SceneData[obj]; - lsri.TaskID = sog.UUID; - lsri.TaskLocalID = sog.LocalId; - lsri.TaskName = sog.GetPartName(obj); - lsri.OwnerName = "waiting"; - lock (uuidNameLookupList) - uuidNameLookupList.Add(sog.OwnerID); - - if (filter.Length != 0) - { - if ((lsri.OwnerName.Contains(filter) || lsri.TaskName.Contains(filter))) - { - } - else - { - continue; - } - } - - SceneReport.Add(lsri); + } + else + { + continue; } } - } + SceneReport.Add(lsri); + } } } + remoteClient.SendLandStatReply(reportType, requestFlags, (uint)SceneReport.Count,SceneReport.ToArray()); if (uuidNameLookupList.Count > 0) diff --git a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs index be399ff..8b78701 100644 --- a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs +++ b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs @@ -85,7 +85,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell IClientAPI client, UUID agentID, UUID sessionID, uint localID, byte saleType, int salePrice) { SceneObjectPart part = m_scene.GetSceneObjectPart(localID); - if (part == null || part.ParentGroup == null) + if (part == null) return; if (part.ParentGroup.IsDeleted) @@ -111,9 +111,6 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell if (part == null) return false; - if (part.ParentGroup == null) - return false; - SceneObjectGroup group = part.ParentGroup; switch (saleType) diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 7cb3751..b9bd9a4 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs @@ -1131,7 +1131,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions SceneObjectPart part = scene.GetSceneObjectPart(objectID); if (part.OwnerID != moverID) { - if (part.ParentGroup != null && !part.ParentGroup.IsDeleted) + if (!part.ParentGroup.IsDeleted) { if (part.ParentGroup.IsAttachment) return false; -- cgit v1.1