diff options
| author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2020-09-28 22:39:06 +0300 | 
|---|---|---|
| committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2020-09-28 22:39:06 +0300 | 
| commit | 83822fd1992140b85966ca613b026c4bc6c38005 (patch) | |
| tree | 8dadfcd76a9c27193e8009d1d361e91e41cf7e71 /indra/newview/llviewerobject.cpp | |
| parent | 652e8459001e052edd6eeef0b919d4d68c8daa58 (diff) | |
| parent | bac6652cdcd2d8333df04c3ebd3a6a7b752328b3 (diff) | |
Merge branch 'master' into DRTVWR-516-maint
# Conflicts:
#	indra/newview/llvocache.cpp
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)  | 
