diff options
author | Vadim Savchuk <vsavchuk@productengine.com> | 2010-07-27 22:34:34 +0300 |
---|---|---|
committer | Vadim Savchuk <vsavchuk@productengine.com> | 2010-07-27 22:34:34 +0300 |
commit | 75980159451eb4f80c1ac03ec4b9d8d488279840 (patch) | |
tree | 610275b8d401180ce0d59841b6224b2101b95531 /indra/newview/llinventoryfunctions.cpp | |
parent | 7bec8b2a9ee1182f9eec14305b7099bee44b7a10 (diff) |
EXT-8491 FIXED Crash in LLAppearanceMgr::addCOFItemLink().
Reason:
When you click on a clothing link in COF, LLAppearanceMgr::wearItemOnAvatar() removes
all COF links of the clicked wearable type -- thus invalidating all previously
obtained LLViewerInventoryItems for those links -- and then passes such an
invalid item (item_to_wear) to addCOFItemLink() which of course crashes.
Fix:
1. Handle this case in wearItemOnAvatar(): don't try wearing COF items.
2. Disable the Wear button in the inventory SP when a COF item is selected.
3. Fixed get_can_item_be_worn() to return FALSE for items which are in COF or have links in COF.
Reviewed by Nyx at https://codereview.productengine.com/secondlife/r/811/
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llinventoryfunctions.cpp')
-rw-r--r-- | indra/newview/llinventoryfunctions.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index f20acbd016..3d350606c6 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -250,6 +250,18 @@ BOOL get_can_item_be_worn(const LLUUID& id) const LLViewerInventoryItem* item = gInventory.getItem(id); if (!item) return FALSE; + + if (LLAppearanceMgr::isLinkInCOF(item->getLinkedUUID())) + { + // an item having links in COF (i.e. a worn item) + return FALSE; + } + + if (gInventory.isObjectDescendentOf(id, LLAppearanceMgr::instance().getCOF())) + { + // a non-link object in COF (should not normally happen) + return FALSE; + } switch(item->getType()) { |