diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2020-09-28 21:21:13 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2020-09-28 21:21:13 +0300 |
commit | 42fa322e76757073ecc8e884f7fd0fb80e0dd4ad (patch) | |
tree | 7be5fd8cdbaef3a6b27893a9a3aa33a6d6fe846e /indra/newview/llviewerobject.cpp | |
parent | c2b55c4362111c124df30eb339461486bda32ec9 (diff) | |
parent | bac6652cdcd2d8333df04c3ebd3a6a7b752328b3 (diff) |
Merged master (DRTVWR-497) into DRTVWR-514-keymappings
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) |