summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorybridge.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2009-12-22 16:41:21 -0500
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2009-12-22 16:41:21 -0500
commit55c1f18c8d70304653d21373d3b71130123945b2 (patch)
tree5f416de0c87818311c18fc02bd42befd28d55e93 /indra/newview/llinventorybridge.cpp
parent722c8b1c7620eb43baa329846cf6410c3ebacc85 (diff)
For EXT-3622: Take off item, wear a different item --> first item is put on again
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rw-r--r--indra/newview/llinventorybridge.cpp36
1 files changed, 24 insertions, 12 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 3fc2cbecbe..beecd48419 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -4555,18 +4555,8 @@ void LLWearableBridge::performAction(LLFolderView* folder, LLInventoryModel* mod
}
else if (isRemoveAction(action))
{
- if (get_is_item_worn(mUUID))
- {
- LLViewerInventoryItem* item = getItem();
- if (item)
- {
- LLWearableList::instance().getAsset(item->getAssetUUID(),
- item->getName(),
- item->getType(),
- LLWearableBridge::onRemoveFromAvatarArrived,
- new OnRemoveStruct(mUUID));
- }
- }
+ removeFromAvatar();
+ return;
}
else LLItemBridge::performAction(folder, model, action);
}
@@ -4949,6 +4939,28 @@ void LLWearableBridge::onRemoveFromAvatarArrived(LLWearable* wearable,
delete on_remove_struct;
}
+/* static */
+void LLWearableBridge::removeItemFromAvatar(LLViewerInventoryItem *item)
+{
+ if (item)
+ {
+ LLWearableList::instance().getAsset(item->getAssetUUID(),
+ item->getName(),
+ item->getType(),
+ LLWearableBridge::onRemoveFromAvatarArrived,
+ new OnRemoveStruct(item->getUUID()));
+ }
+}
+
+void LLWearableBridge::removeFromAvatar()
+{
+ if (get_is_item_worn(mUUID))
+ {
+ LLViewerInventoryItem* item = getItem();
+ removeItemFromAvatar(item);
+ }
+}
+
LLInvFVBridgeAction* LLInvFVBridgeAction::createAction(LLAssetType::EType asset_type,
const LLUUID& uuid,LLInventoryModel* model)
{