diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2019-04-23 15:13:38 +0100 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2019-04-23 15:13:38 +0100 |
commit | 099e58f75b3edc036cff9f6cf5587dacaf16e3fc (patch) | |
tree | 1c0b16399aa35a0d736a935b8a5ba223071da1e7 /indra/newview/llvoavatar.cpp | |
parent | 81dbd3663bdaff741e68de0ec4d4d35bedf6649d (diff) |
SL-10401 - get agent attachment limit from SimulatorFeatures if available
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rw-r--r-- | indra/newview/llvoavatar.cpp | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 321f774210..c9f2ba1a3c 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -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 { |