diff options
| author | andreykproductengine <andreykproductengine@lindenlab.com> | 2019-10-25 18:12:47 +0300 |
|---|---|---|
| committer | andreykproductengine <andreykproductengine@lindenlab.com> | 2019-10-25 18:12:47 +0300 |
| commit | a4199b3e3c389d4291007566739382ee1daad9d6 (patch) | |
| tree | 6a473c8566c0c17bd4954307ad17b6f7b04fec00 /indra/newview/llviewerobject.cpp | |
| parent | 4f5d78522632920586e7e4bf7acbc908f9492edb (diff) | |
SL-12026, SL-1232 and SL-11614
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 1353a27982..0cbfa7d31a 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -279,6 +279,7 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe mOnActiveList(FALSE), mOnMap(FALSE), mStatic(FALSE), + mSeatCount(0), mNumFaces(0), mRotTime(0.f), mAngularVelocityRot(), @@ -890,7 +891,12 @@ void LLViewerObject::addChild(LLViewerObject *childp) if(childp->setParent(this)) { mChildList.push_back(childp); - childp->afterReparent(); + childp->afterReparent(); + + if (childp->isAvatar()) + { + mSeatCount++; + } } } @@ -919,6 +925,11 @@ void LLViewerObject::removeChild(LLViewerObject *childp) { childp->setParent(NULL); } + + if (childp->isAvatar()) + { + mSeatCount--; + } break; } } @@ -976,21 +987,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) |
