diff options
| author | AndreyL ProductEngine <alihatskiy@productengine.com> | 2019-04-26 21:02:00 +0300 |
|---|---|---|
| committer | AndreyL ProductEngine <alihatskiy@productengine.com> | 2019-04-26 21:02:00 +0300 |
| commit | 5e5c5ca09c0add728f366ada48243b82f6aed38c (patch) | |
| tree | 896b668529e2a54c647f014d8d3a70ef1418790b /indra/newview/llvoavatar.cpp | |
| parent | 59457cfcfe946223c2001fa9d9b66683b988315b (diff) | |
| parent | a44f03573d5d64102775922ff0e61f1bce2d1a22 (diff) | |
Merged SL-10400 and SL-10401
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 2682c5b698..20fa327790 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 { |
