split ugly expression in a if making it simpler to read

avinationmerge
UbitUmarov 2012-06-17 09:06:25 +01:00
parent e2b9a5d7aa
commit e7aceae3e0
1 changed files with 5 additions and 3 deletions

View File

@ -2343,9 +2343,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
else else
{ {
// we are a child. The rotation values will be set to the one of root modified by rot, as in SL. Don't ask. // 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;// = m_host.ParentGroup.RootPart; SceneObjectPart rootPart;
if (m_host.ParentGroup != null && ((rootPart = m_host.ParentGroup.RootPart) != null)) // better safe than sorry if (m_host.ParentGroup != null) // better safe than sorry
{ {
rootPart = m_host.ParentGroup.RootPart;
if (rootPart != null)
SetRot(m_host, rootPart.RotationOffset * Rot2Quaternion(rot)); SetRot(m_host, rootPart.RotationOffset * Rot2Quaternion(rot));
} }
} }