summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-04-28 23:03:19 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-04-28 23:06:56 +0300
commitac0c9a7412334ebda49467c14b3916618b56a8dc (patch)
tree32924157b74d3ddd35db67bafe9cb4be2a66cd4f
parent9c0ebc5469f8b98fdcbddd087666b38b88e88c22 (diff)
SL-16721 Crash at LLVOAvatar::idleUpdateMisc
-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 cb50390f60..ccb1662139 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -2819,22 +2819,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];
@@ -2850,8 +2850,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)
{