diff options
author | Dave Houlton <euclid@lindenlab.com> | 2020-09-29 14:02:22 -0600 |
---|---|---|
committer | Dave Houlton <euclid@lindenlab.com> | 2020-09-29 14:02:22 -0600 |
commit | eb6c8c937e214f58cc4da48bd4db455315de4c20 (patch) | |
tree | 529ce1546477d9620c18095ab73e54bbd7ea8d90 /indra/newview/llviewerobject.cpp | |
parent | 7781e1417e5a747a501e76ee9e976226a2656b6a (diff) | |
parent | bac6652cdcd2d8333df04c3ebd3a6a7b752328b3 (diff) |
Merge branch 'master' 6.4.10 into DRTVWR-510
Diffstat (limited to 'indra/newview/llviewerobject.cpp')
-rw-r--r-- | indra/newview/llviewerobject.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 9c91cde09a..aa775b2bab 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -284,6 +284,7 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe mOnActiveList(FALSE), mOnMap(FALSE), mStatic(FALSE), + mSeatCount(0), mNumFaces(0), mRotTime(0.f), mAngularVelocityRot(), @@ -895,7 +896,12 @@ void LLViewerObject::addChild(LLViewerObject *childp) if(childp->setParent(this)) { mChildList.push_back(childp); - childp->afterReparent(); + childp->afterReparent(); + + if (childp->isAvatar()) + { + mSeatCount++; + } } } @@ -924,6 +930,11 @@ void LLViewerObject::removeChild(LLViewerObject *childp) { childp->setParent(NULL); } + + if (childp->isAvatar()) + { + mSeatCount--; + } break; } } @@ -981,21 +992,10 @@ BOOL LLViewerObject::isChild(LLViewerObject *childp) const return FALSE; } - // returns TRUE if at least one avatar is sitting on this object BOOL LLViewerObject::isSeat() const { - for (child_list_t::const_iterator iter = mChildList.begin(); - iter != mChildList.end(); iter++) - { - LLViewerObject* child = *iter; - if (child->isAvatar()) - { - return TRUE; - } - } - return FALSE; - + return mSeatCount > 0; } BOOL LLViewerObject::setDrawableParent(LLDrawable* parentp) |