diff options
author | Eric M. Tulla (BigPapi) <tulla@lindenlab.com> | 2010-02-05 16:16:33 -0500 |
---|---|---|
committer | Eric M. Tulla (BigPapi) <tulla@lindenlab.com> | 2010-02-05 16:16:33 -0500 |
commit | 977de17dda0b3bf5e7ae96f68b329ef0297ce7fd (patch) | |
tree | 6b6187bd80757fe5cc15ce98cb384f2679ef3650 | |
parent | 41ab7853536dcbbf2b64d06b754617ee6bc7e896 (diff) | |
parent | 443993bc19f4517ec41f896443d71110fb6202a7 (diff) |
Automated merge with ssh://hg.lindenlab.com/viewer/viewer-2-0/
-rw-r--r-- | indra/newview/llviewerobject.cpp | 9 | ||||
-rw-r--r-- | indra/newview/llvoavatarself.cpp | 8 |
2 files changed, 13 insertions, 4 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 886f1d9ef5..d0afa9d9de 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -4019,9 +4019,14 @@ LLBBox LLViewerObject::getBoundingBoxAgent() const { LLVector3 position_agent; LLQuaternion rot; + LLViewerObject* avatar_parent = NULL; LLViewerObject* root_edit = (LLViewerObject*)getRootEdit(); - LLViewerObject* avatar_parent = (LLViewerObject*)root_edit->getParent(); - if (avatar_parent && avatar_parent->isAvatar() && root_edit->mDrawable.notNull()) + if (root_edit) + { + avatar_parent = (LLViewerObject*)root_edit->getParent(); + } + + if (avatar_parent && avatar_parent->isAvatar() && root_edit && root_edit->mDrawable.notNull()) { LLXform* parent_xform = root_edit->mDrawable->getXform()->getParent(); position_agent = (getPositionEdit() * parent_xform->getWorldRotation()) + parent_xform->getWorldPosition(); diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index b1ea8a1bbb..13e28b246a 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -510,8 +510,12 @@ BOOL LLVOAvatarSelf::buildMenus() LLVOAvatarSelf::~LLVOAvatarSelf() { - gAgent.setAvatarObject(NULL); - gAgentWearables.setAvatarObject(NULL); + // gAgents pointer might have been set to a different Avatar Self, don't get rid of it if so. + if (gAgent.getAvatarObject() == this) + { + gAgent.setAvatarObject(NULL); + gAgentWearables.setAvatarObject(NULL); + } delete mScreenp; mScreenp = NULL; } |