From e78f96b2fbf7a535b7bc5fe4a0338f354cdae7ed Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" <nyx@lindenlab.com> Date: Fri, 2 Jul 2010 15:55:49 -0400 Subject: [PATCH] EXT-8213 FIX users cannot replace their shape if it does not load Removed checking for wearables loaded on replacing or adding individual items. After reviewing the code in depth, we believe this is safe to do, particularly since we allow the user to replace their outfit from the same state. Filed a followup issue for later investigation EXT-8231 Code reviewed by Vir and Seraph --- indra/newview/llappearancemgr.cpp | 10 ++-------- indra/newview/llinventorybridge.cpp | 24 +++--------------------- indra/newview/lltooldraganddrop.cpp | 17 +++-------------- indra/newview/llwearableitemslist.cpp | 5 +---- 4 files changed, 9 insertions(+), 47 deletions(-) diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index b5ad5c7a112..8ef3fa200b5 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -991,14 +991,8 @@ bool LLAppearanceMgr::wearItemOnAvatar(const LLUUID& item_id_to_wear, bool do_up } } case LLAssetType::AT_BODYPART: - // Don't wear anything until initial wearables are loaded, can - // destroy clothing items. - if (!gAgentWearables.areWearablesLoaded()) - { - LLNotificationsUtil::add("CanNotChangeAppearanceUntilLoaded"); - return false; - } - + // TODO: investigate wearables may not be loaded at this point EXT-8231 + // Remove the existing wearables of the same type. // Remove existing body parts anyway because we must not be able to wear e.g. two skins. if (item_to_wear->getType() == LLAssetType::AT_BODYPART) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 96dba5717ad..735e14de9e4 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -4482,13 +4482,7 @@ void LLWearableBridge::onWearOnAvatar(void* user_data) void LLWearableBridge::wearOnAvatar() { - // Don't wear anything until initial wearables are loaded, can - // destroy clothing items. - if (!gAgentWearables.areWearablesLoaded()) - { - LLNotificationsUtil::add("CanNotChangeAppearanceUntilLoaded"); - return; - } + // TODO: investigate wearables may not be loaded at this point EXT-8231 LLViewerInventoryItem* item = getItem(); if(item) @@ -4499,13 +4493,7 @@ void LLWearableBridge::wearOnAvatar() void LLWearableBridge::wearAddOnAvatar() { - // Don't wear anything until initial wearables are loaded, can - // destroy clothing items. - if (!gAgentWearables.areWearablesLoaded()) - { - LLNotificationsUtil::add("CanNotChangeAppearanceUntilLoaded"); - return; - } + // TODO: investigate wearables may not be loaded at this point EXT-8231 LLViewerInventoryItem* item = getItem(); if(item) @@ -5063,13 +5051,7 @@ BOOL LLWearableBridgeAction::isAgentInventory() const void LLWearableBridgeAction::wearOnAvatar() { - // Don't wear anything until initial wearables are loaded, can - // destroy clothing items. - if (!gAgentWearables.areWearablesLoaded()) - { - LLNotificationsUtil::add("CanNotChangeAppearanceUntilLoaded"); - return; - } + // TODO: investigate wearables may not be loaded at this point EXT-8231 LLViewerInventoryItem* item = getItem(); if(item) diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index c862c02b82b..3f34fc174c6 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -1871,13 +1871,8 @@ EAcceptance LLToolDragAndDrop::dad3dWearItem( if (drop) { - // Don't wear anything until initial wearables are loaded, can - // destroy clothing items. - if (!gAgentWearables.areWearablesLoaded()) - { - LLNotificationsUtil::add("CanNotChangeAppearanceUntilLoaded"); - return ACCEPT_NO; - } + // TODO: investigate wearables may not be loaded at this point EXT-8231 + LLAppearanceMgr::instance().wearItemOnAvatar(item->getUUID(),true, !(mask & MASK_CONTROL)); } return ACCEPT_YES_MULTI; @@ -1949,13 +1944,7 @@ EAcceptance LLToolDragAndDrop::dad3dWearCategory( if (drop) { - // Don't wear anything until initial wearables are loaded, can - // destroy clothing items. - if (!gAgentWearables.areWearablesLoaded()) - { - LLNotificationsUtil::add("CanNotChangeAppearanceUntilLoaded"); - return ACCEPT_NO; - } + // TODO: investigate wearables may not be loaded at this point EXT-8231 } if (mSource == SOURCE_AGENT) diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index 868322699ef..d24bd8499da 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -783,10 +783,7 @@ void LLWearableItemsList::ContextMenu::createNewWearable(const LLUUID& item_id) // static bool LLWearableItemsList::ContextMenu::canAddWearable(const LLUUID& item_id) { - if (!gAgentWearables.areWearablesLoaded()) - { - return false; - } + // TODO: investigate wearables may not be loaded at this point EXT-8231 LLViewerInventoryItem* item = gInventory.getItem(item_id); if (!item || item->getType() != LLAssetType::AT_CLOTHING) -- GitLab