Try to fix login crash

0.6.1-post-fixes
Melanie Thielker 2008-11-17 05:37:24 +00:00
parent fa50156b4c
commit 3f4aeccca3
1 changed files with 8 additions and 5 deletions

View File

@ -424,14 +424,17 @@ namespace OpenSim.Region.Environment.Scenes
m_groupPosition.Y = PhysActor.Position.Y; m_groupPosition.Y = PhysActor.Position.Y;
m_groupPosition.Z = PhysActor.Position.Z; 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 (m_parentGroup != null && m_parentGroup.RootPart != null)
{
ScenePresence sp = m_parentGroup.Scene.GetScenePresence(m_parentGroup.RootPart.AttachedAvatar);
if (sp != null) if (sp != null)
{ {
return sp.AbsolutePosition; return sp.AbsolutePosition;
} }
} }
}
return m_groupPosition; return m_groupPosition;
} }
@ -743,7 +746,7 @@ if (m_shape != null) {
public Vector3 AbsolutePosition public Vector3 AbsolutePosition
{ {
get { get {
if (ParentGroup != null && ParentGroup.RootPart != null && ParentGroup.RootPart.IsAttachment) if (IsAttachment)
return GroupPosition; return GroupPosition;
return m_offsetPosition + m_groupPosition; } return m_offsetPosition + m_groupPosition; }