From 7eca929686bd2db1cb42f5c9740fd1d186cdc8b1 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 1 Sep 2011 02:09:41 +0100 Subject: Eliminate pointless checks of SOG.RootPart != null It's never possible for SOG to have no RootPart, except in the first few picosends of the big bang when it's pulled from region persistence or deserialized --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 7 +------ OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 3 +-- 2 files changed, 2 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 8d95546..2fd98f6 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2767,8 +2767,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // If either of these are null, then there was an unknown error. if (new_group == null) continue; - if (new_group.RootPart == null) - continue; // objects rezzed with this method are die_at_edge by default. new_group.RootPart.SetDieAtEdge(true); @@ -6983,10 +6981,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { // we are a child. The rotation values will be set to the one of root modified by rot, as in SL. Don't ask. SceneObjectPart rootPart = part.ParentGroup.RootPart; - if (rootPart != null) // better safe than sorry - { - SetRot(part, rootPart.RotationOffset * Rot2Quaternion(q)); - } + SetRot(part, rootPart.RotationOffset * Rot2Quaternion(q)); } break; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 7f3d84d..3ddd79b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -673,8 +673,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.AddScriptLPS(1); - if (m_host.ParentGroup.RootPart != null) - m_host.ParentGroup.RootPart.SetFloatOnWater(floatYN); + m_host.ParentGroup.RootPart.SetFloatOnWater(floatYN); } // Teleport functions -- cgit v1.1