diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2017-09-22 18:04:03 +0100 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2017-09-22 18:04:03 +0100 |
commit | a6068419e7fe1a5a0eda007b2e989769c0a92262 (patch) | |
tree | 8faf3e8004b6ec1e79d611a86e9c9c131f156702 /indra/newview/llvoavatar.cpp | |
parent | a634d878098cff98b0622d492f5454a1bd41cff6 (diff) |
SL-794, SL-790 - viewer-side enforcement in UI for various animated object limits that are also enforced on the server.
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rw-r--r-- | indra/newview/llvoavatar.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 5e0c5d6858..ac5d1b335c 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6603,12 +6603,31 @@ U32 LLVOAvatar::getNumAnimatedObjectAttachments() const } //----------------------------------------------------------------------------- +// getMaxAnimatedObjectAttachments() +// Gets from simulator feature if available, otherwise 0. +//----------------------------------------------------------------------------- +S32 LLVOAvatar::getMaxAnimatedObjectAttachments() const +{ + S32 max_attach = 0; + LLSD features; + if (getRegion()) + { + getRegion()->getSimulatorFeatures(features); + if (features.has("AnimatedObjects")) + { + max_attach = features["AnimatedObjects"]["MaxAgentAnimatedObjectAttachments"].asInteger(); + } + } + return max_attach; +} + +//----------------------------------------------------------------------------- // canAttachMoreAnimatedObjects() // Returns true if we can attach <n> more animated objects. //----------------------------------------------------------------------------- BOOL LLVOAvatar::canAttachMoreAnimatedObjects(U32 n) const { - return (getNumAnimatedObjectAttachments() + n) <= MAX_AGENT_ANIMATED_OBJECT_ATTACHMENTS; + return (getNumAnimatedObjectAttachments() + n) <= getMaxAnimatedObjectAttachments(); } //----------------------------------------------------------------------------- |