Skip to content

Commit 3c8d3a6

Browse files
committed
Harden layer reorder against unintended/partial changes
1 parent a96333e commit 3c8d3a6

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

indra/llui/llflatlistview.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,10 @@ void LLFlatListView::onItemMouseClick(item_pair_t* item_pair, MASK mask)
687687
setFocus(true);
688688
}
689689

690-
armReorderDrag(item_pair);
690+
if (!(mask & (MASK_SHIFT | MASK_CONTROL)))
691+
{
692+
armReorderDrag(item_pair);
693+
}
691694

692695
bool select_item = !isSelected(item_pair);
693696

indra/newview/llappearancemgr.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4571,6 +4571,13 @@ bool LLAppearanceMgr::reorderWearableGroup(LLWearableType::EType type, const uui
45714571
if (count < 2) return false;
45724572
if (ordered_link_ids.size() != count) return false; // order must cover the whole group
45734573

4574+
// Validate everything before mutating, so a bad link can't leave it half-reordered.
4575+
for (const LLUUID& link_id : ordered_link_ids)
4576+
{
4577+
LLViewerInventoryItem* link = gInventory.getItem(link_id);
4578+
if (!link || link->getWearableType() != type) return false;
4579+
}
4580+
45744581
// ordered_link_ids runs furthest-to-closest; body index 0 is closest to the body.
45754582
// Place each target at its body index, leaving already-placed lower indices untouched.
45764583
for (U32 body_index = 0; body_index < count; ++body_index)

0 commit comments

Comments
 (0)