From 3f4aeccca30dffc51603be0e373968f9b8f23037 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 17 Nov 2008 05:37:24 +0000 Subject: [PATCH] Try to fix login crash --- .../Region/Environment/Scenes/SceneObjectPart.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index daf1b5e06d..a7eb0b7cdd 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -424,12 +424,15 @@ namespace OpenSim.Region.Environment.Scenes m_groupPosition.Y = PhysActor.Position.Y; m_groupPosition.Z = PhysActor.Position.Z; } - if (ParentGroup != null && ParentGroup.RootPart != null && ParentGroup.RootPart.IsAttachment) + if (IsAttachment) { - ScenePresence sp = m_parentGroup.Scene.GetScenePresence(ParentGroup.RootPart.AttachedAvatar); - if (sp != null) + if (m_parentGroup != null && m_parentGroup.RootPart != null) { - return sp.AbsolutePosition; + ScenePresence sp = m_parentGroup.Scene.GetScenePresence(m_parentGroup.RootPart.AttachedAvatar); + if (sp != null) + { + return sp.AbsolutePosition; + } } } @@ -743,7 +746,7 @@ if (m_shape != null) { public Vector3 AbsolutePosition { get { - if (ParentGroup != null && ParentGroup.RootPart != null && ParentGroup.RootPart.IsAttachment) + if (IsAttachment) return GroupPosition; return m_offsetPosition + m_groupPosition; }