summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2024-07-08 16:40:02 -0400
committerNat Goodspeed <nat@lindenlab.com>2024-07-08 16:40:02 -0400
commit0e5cee5d6ddad76ccd37b5ed6bf8d692435bb7dc (patch)
tree08437f969be9bb2b3b9698239fe9111461a989d9
parent2918ebc081f63bffd5c482375f7fcbbb2faea175 (diff)
Slightly simplify LLAppearanceListener::wearItems(), detachItems().
-rw-r--r--indra/newview/llappearancelistener.cpp34
1 files changed, 18 insertions, 16 deletions
diff --git a/indra/newview/llappearancelistener.cpp b/indra/newview/llappearancelistener.cpp
index b8aca96b43..c39799c5e9 100644
--- a/indra/newview/llappearancelistener.cpp
+++ b/indra/newview/llappearancelistener.cpp
@@ -91,36 +91,38 @@ void LLAppearanceListener::wearOutfit(LLSD const &data)
void LLAppearanceListener::wearItems(LLSD const &data)
{
- if (data["items_id"].isArray())
+ const LLSD& items_id{ data["items_id"] };
+ uuid_vec_t ids;
+ if (! items_id.isArray())
{
- uuid_vec_t ids;
- for (const auto &id : llsd::inArray(data["items_id"]))
+ 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());
- }
- else
- {
- LLAppearanceMgr::instance().wearItemOnAvatar(data["items_id"].asUUID(), true, data["replace"].asBoolean());
}
+ LLAppearanceMgr::instance().wearItemsOnAvatar(ids, true, data["replace"].asBoolean());
}
void LLAppearanceListener::detachItems(LLSD const &data)
{
- if (data["items_id"].isArray())
+ const LLSD& items_id{ data["items_id"] };
+ uuid_vec_t ids;
+ if (! items_id.isArray())
{
- uuid_vec_t ids;
- for (const auto &id : llsd::inArray(data["items_id"]))
+ ids.push_back(items_id.asUUID());
+ }
+ else // array
+ {
+ for (const auto &id : llsd::inArray(items_id))
{
ids.push_back(id);
}
- LLAppearanceMgr::instance().removeItemsFromAvatar(ids);
- }
- else
- {
- LLAppearanceMgr::instance().removeItemFromAvatar(data["items_id"].asUUID());
}
+ LLAppearanceMgr::instance().removeItemsFromAvatar(ids);
}
void LLAppearanceListener::getOutfitsList(LLSD const &data)