diff options
author | Aimee Linden <aimee@lindenlab.com> | 2010-03-29 17:53:21 +0100 |
---|---|---|
committer | Aimee Linden <aimee@lindenlab.com> | 2010-03-29 17:53:21 +0100 |
commit | eb0aaff4aac1dcf9f238242c107df650584efdf9 (patch) | |
tree | b07b612c33f23e820492b06488a8c406856b64c8 /indra/newview/llviewerobject.cpp | |
parent | fc0906d6e8c1238fe7fd21c185957ca89511e76e (diff) | |
parent | b6e7850c0a3d65ed0a1501e19a1655055000e32f (diff) |
Merge
Diffstat (limited to 'indra/newview/llviewerobject.cpp')
-rw-r--r-- | indra/newview/llviewerobject.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index abcb7e5452..8860b734bb 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -134,7 +134,15 @@ LLViewerObject *LLViewerObject::createObject(const LLUUID &id, const LLPCode pco { if (id == gAgentID) { - res = new LLVOAvatarSelf(id, pcode, regionp); + if (!gAgentAvatarp) + { + gAgentAvatarp = new LLVOAvatarSelf(id, pcode, regionp); + } + else + { + gAgentAvatarp->updateRegion(regionp); + } + res = gAgentAvatarp; } else { @@ -223,7 +231,7 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe mClickAction(0), mAttachmentItemID(LLUUID::null) { - if(!is_global) + if (!is_global) { llassert(mRegionp); } @@ -235,7 +243,7 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe mPositionRegion = LLVector3(0.f, 0.f, 0.f); - if(!is_global) + if (!is_global && mRegionp) { mPositionAgent = mRegionp->getOriginAgent(); } @@ -377,11 +385,10 @@ void LLViewerObject::markDead() if (flagAnimSource()) { - LLVOAvatarSelf* avatarp = gAgent.getAvatarObject(); - if (avatarp && !avatarp->isDead()) + if (isAgentAvatarValid()) { // stop motions associated with this object - avatarp->stopMotionFromSource(mID); + gAgentAvatarp->stopMotionFromSource(mID); } } @@ -4920,7 +4927,6 @@ void LLViewerObject::setIncludeInSearch(bool include_in_search) void LLViewerObject::setRegion(LLViewerRegion *regionp) { - llassert(regionp); mLatestRecvPacketID = 0; mRegionp = regionp; |