summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llappearancelistener.cpp5
-rw-r--r--indra/newview/llappearancemgr.cpp13
-rw-r--r--indra/newview/llappearancemgr.h3
3 files changed, 16 insertions, 5 deletions
diff --git a/indra/newview/llappearancelistener.cpp b/indra/newview/llappearancelistener.cpp
index 3db2c64b78..b29eb48a1b 100644
--- a/indra/newview/llappearancelistener.cpp
+++ b/indra/newview/llappearancelistener.cpp
@@ -100,7 +100,7 @@ void LLAppearanceListener::wearOutfitByName(LLSD const &data)
{
Response response(LLSD(), data);
std::string error_msg;
- if (!LLAppearanceMgr::instance().wearOutfitByName(data["folder_name"].asString(), data["append"].asBoolean(), error_msg))
+ if (!LLAppearanceMgr::instance().wearOutfitByName(data["folder_name"].asString(), error_msg, data["append"].asBoolean()))
{
response.error(error_msg);
}
@@ -147,7 +147,8 @@ void LLAppearanceListener::getOutfitItems(LLSD const &data)
LLInventoryModel::cat_array_t cat_array;
LLInventoryModel::item_array_t item_array;
- gInventory.collectDescendentsIf(outfit_id, cat_array, item_array, LLInventoryModel::EXCLUDE_TRASH, LLFindOutfitItems());
+ LLFindOutfitItems collector = LLFindOutfitItems();
+ gInventory.collectDescendentsIf(outfit_id, cat_array, item_array, LLInventoryModel::EXCLUDE_TRASH, collector);
LLSD items_data;
for (const LLPointer<LLViewerInventoryItem> &it : item_array)
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 3d13f8afc8..e4a545a55b 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -2904,7 +2904,7 @@ void LLAppearanceMgr::wearInventoryCategoryOnAvatar( LLInventoryCategory* catego
LLAppearanceMgr::changeOutfit(TRUE, category->getUUID(), append);
}
-bool LLAppearanceMgr::wearOutfitByName(const std::string& name, bool append, std::string& error_msg)
+bool LLAppearanceMgr::wearOutfitByName(const std::string& name, std::string& error_msg, bool append)
{
LL_INFOS("Avatar") << self_av_string() << "Wearing category " << name << LL_ENDL;
@@ -2950,7 +2950,6 @@ bool LLAppearanceMgr::wearOutfitByName(const std::string& name, bool append, std
{
std::string msg = append ? LLTrans::getString("OutfitNotAdded") : LLTrans::getString("OutfitNotReplaced");
error_msg = stringize(msg, std::quoted(name), ", id: ", cat->getUUID());
- LL_WARNS() << error_msg << LL_ENDL;
return false;
}
LLAppearanceMgr::wearInventoryCategory(cat, copy_items, append);
@@ -2958,6 +2957,16 @@ bool LLAppearanceMgr::wearOutfitByName(const std::string& name, bool append, std
else
{
error_msg = stringize(LLTrans::getString("OutfitNotFound"), std::quoted(name));
+ return false;
+ }
+ return true;
+}
+
+bool LLAppearanceMgr::wearOutfitByName(const std::string& name, bool append)
+{
+ std::string error_msg;
+ if(!wearOutfitByName(name, error_msg, append))
+ {
LL_WARNS() << error_msg << LL_ENDL;
return false;
}
diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h
index d7b6cd5a61..adc783be5a 100644
--- a/indra/newview/llappearancemgr.h
+++ b/indra/newview/llappearancemgr.h
@@ -59,7 +59,8 @@ public:
void wearInventoryCategory(LLInventoryCategory* category, bool copy, bool append);
void wearInventoryCategoryOnAvatar(LLInventoryCategory* category, bool append);
void wearCategoryFinal(const LLUUID& cat_id, bool copy_items, bool append);
- bool wearOutfitByName(const std::string &name, bool append = false, std::string &error_msg = std::string());
+ bool wearOutfitByName(const std::string &name, std::string &error_msg, bool append = false);
+ bool wearOutfitByName(const std::string &name, bool append = false);
void changeOutfit(bool proceed, const LLUUID& category, bool append);
void replaceCurrentOutfit(const LLUUID& new_outfit);
void renameOutfit(const LLUUID& outfit_id);