diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 22478d29c9..ac6577de0e 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -5532,7 +5532,14 @@ class LLWearableBridgeAction: public LLInvFVBridgeAction public: virtual void doIt() { - wearOnAvatar(); + // TODO: investigate wearables may not be loaded at this point EXT-8231 + + LLViewerInventoryItem* item = getItem(); + if(item) + { + if ( get_is_item_worn(mUUID) ) LLAppearanceMgr::instance().removeItemFromAvatar(mUUID); + else LLAppearanceMgr::instance().wearItemOnAvatar(mUUID /*item->getUUID()*/, true, true); + } } virtual ~LLWearableBridgeAction(){} protected: @@ -5541,7 +5548,6 @@ protected: // return true if the item is in agent inventory. if false, it // must be lost or in the inventory library. BOOL isAgentInventory() const; - void wearOnAvatar(); }; BOOL LLWearableBridgeAction::isItemInTrash() const @@ -5558,17 +5564,6 @@ BOOL LLWearableBridgeAction::isAgentInventory() const return mModel->isObjectDescendentOf(mUUID, gInventory.getRootFolderID()); } -void LLWearableBridgeAction::wearOnAvatar() -{ - // TODO: investigate wearables may not be loaded at this point EXT-8231 - - LLViewerInventoryItem* item = getItem(); - if(item) - { - LLAppearanceMgr::instance().wearItemOnAvatar(item->getUUID(), true, true); - } -} - LLInvFVBridgeAction* LLInvFVBridgeAction::createAction(LLAssetType::EType asset_type, const LLUUID& uuid, LLInventoryModel* model)