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
This commit is contained in:
Justin Clark-Casey (justincc)
2011-09-01 02:09:41 +01:00
parent 10d883dc88
commit 7eca929686
12 changed files with 126 additions and 212 deletions

View File

@@ -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;

View File

@@ -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