From 0a5eaf89bc0bbe47290629d465aa0503dd73a513 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Wed, 28 Jul 2010 21:23:14 +0300 Subject: EXT-8258 ADDITIONAL FIX Enable the 'Trash' button in 'My Inventory' when a selected item gets worn. This is an additional fix to the one approved in https://codereview.productengine.com/secondlife/r/772/. Looks like sometimes get_is_item_worn() fails to determine that an item is actually worn. I suppose it happens when the item is already linked to COF but not yet known to LLAgentWearables. So I try fixing it by adding a COF links check to get_is_item_worn(), so that an item is considered worn as soon as it's linked to COF. Reviewed by Nyx at https://codereview.productengine.com/secondlife/r/822/ --HG-- branch : product-engine --- indra/newview/llinventoryfunctions.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 86af76e0a4..303031ab29 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -221,7 +221,13 @@ BOOL get_is_item_worn(const LLUUID& id) const LLViewerInventoryItem* item = gInventory.getItem(id); if (!item) return FALSE; - + + // Consider the item as worn if it has links in COF. + if (LLAppearanceMgr::instance().isLinkInCOF(id)) + { + return TRUE; + } + switch(item->getType()) { case LLAssetType::AT_OBJECT: -- cgit v1.2.3