summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerobjectlist.cpp
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2010-03-29 12:00:26 -0400
committerLoren Shih <seraph@lindenlab.com>2010-03-29 12:00:26 -0400
commit94e6e10739c8321b6fb651a109901380ef92975a (patch)
tree629fec2892c2bb0bce4f35f42ef4cad54408f174 /indra/newview/llviewerobjectlist.cpp
parent46fe5d49caef6c8db3df9d88f0d0ec773ef28095 (diff)
EXT-6536 : Make LLVOAvatarSelf a singleton
Superficial cleanup to replace all instances of "LLVOAvatarSelf *avatarp = gAgent.getAvatarObject" with "gAgentAvatar".
Diffstat (limited to 'indra/newview/llviewerobjectlist.cpp')
-rw-r--r--indra/newview/llviewerobjectlist.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index 64a7b2166b..eb966a1535 100644
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -474,7 +474,6 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
if (objectp->getRegion() != regionp)
{ // Object changed region, so update it
- objectp->setRegion(regionp);
objectp->updateRegion(regionp); // for LLVOAvatar
}
}
@@ -895,6 +894,13 @@ void LLViewerObjectList::removeDrawable(LLDrawable* drawablep)
BOOL LLViewerObjectList::killObject(LLViewerObject *objectp)
{
+ // Don't ever kill gAgentAvatar, just mark it as null region instead.
+ if (objectp == gAgentAvatar)
+ {
+ objectp->setRegion(NULL);
+ return FALSE;
+ }
+
// When we're killing objects, all we do is mark them as dead.
// We clean up the dead objects later.
@@ -1210,11 +1216,10 @@ void LLViewerObjectList::generatePickList(LLCamera &camera)
}
// add all hud objects to pick list
- LLVOAvatarSelf* avatarp = gAgent.getAvatarObject();
- if (avatarp)
+ if (isAgentAvatarValid())
{
- for (LLVOAvatar::attachment_map_t::iterator iter = avatarp->mAttachmentPoints.begin();
- iter != avatarp->mAttachmentPoints.end(); )
+ for (LLVOAvatar::attachment_map_t::iterator iter = gAgentAvatar->mAttachmentPoints.begin();
+ iter != gAgentAvatar->mAttachmentPoints.end(); )
{
LLVOAvatar::attachment_map_t::iterator curiter = iter++;
LLViewerJointAttachment* attachment = curiter->second;