diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2024-07-09 10:24:32 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2024-07-09 10:24:32 -0400 |
commit | f009f8da6b140f02f6463a43d336ab2644782fa1 (patch) | |
tree | 42ae287114dbc042e75f189c1237be2d81d7f41d /indra/newview | |
parent | b8c09ed80d076f44b08d6aaa59fffd98abd55811 (diff) |
Introduce LLSDParam<vector<T>> and LLSDParam<map<string, T>>.
Use LLSDParam<uuid_vec_t> in LLAppearanceListener::wearItems() and
detachItems() to build the vector of LLUUIDs from the passed LLSD array.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llappearancelistener.cpp | 33 |
1 files changed, 5 insertions, 28 deletions
diff --git a/indra/newview/llappearancelistener.cpp b/indra/newview/llappearancelistener.cpp index c39799c5e9..0dab352311 100644 --- a/indra/newview/llappearancelistener.cpp +++ b/indra/newview/llappearancelistener.cpp @@ -91,38 +91,15 @@ void LLAppearanceListener::wearOutfit(LLSD const &data) void LLAppearanceListener::wearItems(LLSD const &data) { - const LLSD& items_id{ data["items_id"] }; - uuid_vec_t ids; - if (! items_id.isArray()) - { - ids.push_back(items_id.asUUID()); - } - else // array - { - for (const auto &id : llsd::inArray(items_id)) - { - ids.push_back(id); - } - } - LLAppearanceMgr::instance().wearItemsOnAvatar(ids, true, data["replace"].asBoolean()); + LLAppearanceMgr::instance().wearItemsOnAvatar( + LLSDParam<uuid_vec_t>(data["items_id"]), + true, data["replace"].asBoolean()); } void LLAppearanceListener::detachItems(LLSD const &data) { - const LLSD& items_id{ data["items_id"] }; - uuid_vec_t ids; - if (! items_id.isArray()) - { - ids.push_back(items_id.asUUID()); - } - else // array - { - for (const auto &id : llsd::inArray(items_id)) - { - ids.push_back(id); - } - } - LLAppearanceMgr::instance().removeItemsFromAvatar(ids); + LLAppearanceMgr::instance().removeItemsFromAvatar( + LLSDParam<uuid_vec_t>(data["items_id"])); } void LLAppearanceListener::getOutfitsList(LLSD const &data) |