From 86eec90d97c03ac0f6be8897041185c6b5601968 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 21 Aug 2024 20:43:38 +0300 Subject: Add item limit for collectDescendentsIf func; add demo script --- indra/newview/llinventorymodel.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/newview/llinventorymodel.cpp') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 5325c28abf..c98c3482d0 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1289,6 +1289,10 @@ void LLInventoryModel::collectDescendentsIf(const LLUUID& id, S32 count = cat_array->size(); for(S32 i = 0; i < count; ++i) { + if (add.exceedsLimit()) + { + break; + } LLViewerInventoryCategory* cat = cat_array->at(i); if(add(cat,NULL)) { @@ -1307,6 +1311,10 @@ void LLInventoryModel::collectDescendentsIf(const LLUUID& id, S32 count = item_array->size(); for(S32 i = 0; i < count; ++i) { + if (add.exceedsLimit()) + { + break; + } item = item_array->at(i); if(add(NULL, item)) { -- cgit v1.2.3