summaryrefslogtreecommitdiff
path: root/indra/newview/llselectmgr.cpp
diff options
context:
space:
mode:
authorandreykproductengine <akleshchev@productengine.com>2015-06-25 16:36:38 +0300
committerandreykproductengine <akleshchev@productengine.com>2015-06-25 16:36:38 +0300
commit1845816aa2419353ace258b7cfe24bdd08357ebe (patch)
tree1973e2db379939e0bd1f66e2cf6e47151b545847 /indra/newview/llselectmgr.cpp
parentae89d5b4d9bbfa18f530f29f4db8c9d38bb52807 (diff)
MAINT-5299 FIXED [MAINT-RC] Unlinking individual prims from a linkset no longer works
Diffstat (limited to 'indra/newview/llselectmgr.cpp')
-rwxr-xr-xindra/newview/llselectmgr.cpp20
1 files changed, 6 insertions, 14 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index cbc00d8b53..47a9353ffa 100755
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -619,22 +619,14 @@ bool LLSelectMgr::linkObjects()
bool LLSelectMgr::unlinkObjects()
{
- LLViewerObject *object = mSelectedObjects->getFirstRootObject();
- if (!object) return false;
-
S32 min_objects_for_confirm = gSavedSettings.getS32("MinObjectsForUnlinkConfirm");
- for (LLObjectSelection::root_iterator iter = getSelection()->root_begin(); iter != getSelection()->root_end(); iter++)
+ S32 unlink_object_count = mSelectedObjects->getObjectCount(); // clears out nodes with NULL objects
+ if (unlink_object_count >= min_objects_for_confirm
+ && unlink_object_count > mSelectedObjects->getRootObjectCount())
{
- object = (*iter)->getObject();
- if(object)
- {
- S32 objects_in_linkset = object->numChildren() + 1;
- if(objects_in_linkset >= min_objects_for_confirm)
- {
- LLNotificationsUtil::add("ConfirmUnlink", LLSD(), LLSD(), boost::bind(&LLSelectMgr::confirmUnlinkObjects, this, _1, _2));
- return true;
- }
- }
+ // total count > root count means that there are childer inside and that there are linksets that will be unlinked
+ LLNotificationsUtil::add("ConfirmUnlink", LLSD(), LLSD(), boost::bind(&LLSelectMgr::confirmUnlinkObjects, this, _1, _2));
+ return true;
}
LLSelectMgr::getInstance()->sendDelink();