summaryrefslogtreecommitdiff
path: root/indra/newview/llvoavatar.cpp
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-05-08 09:30:39 -0700
committerGraham Linden <graham@lindenlab.com>2019-05-08 09:30:39 -0700
commit470d1595cc1c1c7c7ec3ab192e68622751423354 (patch)
tree079cd01cc1b247973f2e5fd589389cc8e0013b13 /indra/newview/llvoavatar.cpp
parent06097302f4ad8786913e77514d5d60678da3160d (diff)
parent34322f8f37380df868703051230f2a4109602b3f (diff)
Merge viewer-release
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rw-r--r--indra/newview/llvoavatar.cpp29
1 files changed, 25 insertions, 4 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index d13b926930..22fde86870 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -5992,7 +5992,7 @@ void LLVOAvatar::rebuildAttachmentOverrides()
LLViewerObject *vo = *at_it;
// Attached animated objects affect joints in their control
// avs, not the avs to which they are attached.
- if (!vo->isAnimatedObject())
+ if (vo && !vo->isAnimatedObject())
{
addAttachmentOverridesForObject(vo);
}
@@ -6043,7 +6043,7 @@ void LLVOAvatar::updateAttachmentOverrides()
LLViewerObject *vo = *at_it;
// Attached animated objects affect joints in their control
// avs, not the avs to which they are attached.
- if (!vo->isAnimatedObject())
+ if (vo && !vo->isAnimatedObject())
{
addAttachmentOverridesForObject(vo, &meshes_seen);
}
@@ -7037,12 +7037,33 @@ U32 LLVOAvatar::getNumAttachments() const
}
//-----------------------------------------------------------------------------
+// getMaxAttachments()
+//-----------------------------------------------------------------------------
+S32 LLVOAvatar::getMaxAttachments() const
+{
+ const S32 MAX_AGENT_ATTACHMENTS = 38;
+
+ S32 max_attach = MAX_AGENT_ATTACHMENTS;
+
+ if (gAgent.getRegion())
+ {
+ LLSD features;
+ gAgent.getRegion()->getSimulatorFeatures(features);
+ if (features.has("MaxAgentAttachments"))
+ {
+ max_attach = features["MaxAgentAttachments"].asInteger();
+ }
+ }
+ return max_attach;
+}
+
+//-----------------------------------------------------------------------------
// canAttachMoreObjects()
// Returns true if we can attach <n> more objects.
//-----------------------------------------------------------------------------
BOOL LLVOAvatar::canAttachMoreObjects(U32 n) const
{
- return (getNumAttachments() + n) <= MAX_AGENT_ATTACHMENTS;
+ return (getNumAttachments() + n) <= getMaxAttachments();
}
//-----------------------------------------------------------------------------
@@ -7070,7 +7091,7 @@ S32 LLVOAvatar::getMaxAnimatedObjectAttachments() const
S32 max_attach = 0;
if (gSavedSettings.getBOOL("AnimatedObjectsIgnoreLimits"))
{
- max_attach = MAX_AGENT_ATTACHMENTS;
+ max_attach = getMaxAttachments();
}
else
{