summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerobject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerobject.cpp')
-rw-r--r--indra/newview/llviewerobject.cpp26
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)