summaryrefslogtreecommitdiff
path: root/indra/newview/llvoavatar.cpp
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2022-05-05 12:59:50 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2022-05-05 14:06:30 +0300
commit10e8ea5ff884b3466587f078c1b62204605eff06 (patch)
tree6db3f240f9ec354ae5ed36bb87410df4b889e828 /indra/newview/llvoavatar.cpp
parent9e352924207447ab294f9581cfc349e17fdd6f6b (diff)
parentf3add82a4c7f34bfff285302c34d952902451cad (diff)
Merge branch 'DRTVWR-546' into DRTVWR-539
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rw-r--r--indra/newview/llvoavatar.cpp32
1 files changed, 18 insertions, 14 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 33f2ec81ab..625fdf1977 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -2823,22 +2823,22 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update)
attachment_iter != attachment->mAttachedObjects.end();
++attachment_iter)
{
- LLViewerObject* attached_object = attachment_iter->get();
- BOOL visibleAttachment = visible || (attached_object && attached_object->mDrawable.notNull() &&
- !(attached_object->mDrawable->getSpatialBridge() &&
- attached_object->mDrawable->getSpatialBridge()->getRadius() < 2.0));
+ LLViewerObject* attached_object = attachment_iter->get();
+ if (!attached_object
+ || attached_object->isDead()
+ || !attachment->getValid()
+ || attached_object->mDrawable.isNull())
+ {
+ continue;
+ }
+
+ LLSpatialBridge* bridge = attached_object->mDrawable->getSpatialBridge();
- if (visibleAttachment
- && attached_object
- && !attached_object->isDead()
- && attachment->getValid()
- && attached_object->mDrawable.notNull())
+ if (visible || !(bridge && bridge->getRadius() < 2.0))
{
-
//override rigged attachments' octree spatial extents with this avatar's bounding box
- LLSpatialBridge* bridge = attached_object->mDrawable->getSpatialBridge();
bool rigged = false;
- if (bridge && !bridge->isDead())
+ if (bridge)
{
//transform avatar bounding box into attachment's coordinate frame
LLVector4a extents[2];
@@ -2854,8 +2854,12 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update)
attached_object->mDrawable->makeActive();
attached_object->mDrawable->updateXform(TRUE);
-
- if (bridge && !bridge->isDead())
+
+ // override_bbox calls movePartition() and getSpatialPartition(),
+ // so bridge might no longer be valid, get it again.
+ // ex: animesh stops being an animesh
+ bridge = attached_object->mDrawable->getSpatialBridge();
+ if (bridge)
{
if (!rigged)
{