summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2025-07-23 21:41:07 +0800
committerErik Kundiman <erik@megapahit.org>2025-07-23 21:41:07 +0800
commit4ad9d65514374006a9474c9fd42254c95680458f (patch)
tree7314f39fcf43926fdfc2402870b0eff29eabcd37
parent1878bf4eb76e4a79d1622aa6b907362bb94bc0f6 (diff)
@detach:<folder_name>=force implementation
Per specification, the folder must be directly under "#RLV" for this to work, hence not using the shared folder ID retrieval macro.
-rw-r--r--indra/newview/rlvhandler.cpp22
-rw-r--r--indra/newview/rlvhelper.cpp1
2 files changed, 23 insertions, 0 deletions
diff --git a/indra/newview/rlvhandler.cpp b/indra/newview/rlvhandler.cpp
index e9bd715a98..14343143cd 100644
--- a/indra/newview/rlvhandler.cpp
+++ b/indra/newview/rlvhandler.cpp
@@ -351,6 +351,28 @@ ECmdRet ForceHandler<EBehaviour::AttachOver>::onCommand(const RlvCommand& rlvCmd
RESTRAINED_LOVE_OUTFIT(RESTRAINED_LOVE_ADD);
}
+template<> template<>
+ECmdRet ForceHandler<EBehaviour::Detach>::onCommand(const RlvCommand& rlvCmd)
+{
+ auto folderID = gInventory.getRootFolderID();
+ LLNameCategoryCollector has_name("#RLV");
+ if (!gInventory.hasMatchingDirectDescendent(folderID, has_name))
+ return ECmdRet::FailedNoSharedRoot;
+ folderID = findDescendentCategoryIDByName(folderID, "#RLV");
+ std::vector<std::string> optionList;
+ auto option = rlvCmd.getOption();
+ if (!option.empty())
+ {
+ LLNameCategoryCollector is_named(option);
+ if (gInventory.hasMatchingDirectDescendent(folderID, is_named))
+ {
+ folderID = findDescendentCategoryIDByName(folderID, option);
+ LLAppearanceMgr::instance().takeOffOutfit(folderID);
+ }
+ }
+ return ECmdRet::Succeeded;
+}
+
// AddRem
ECmdRet CommandHandlerBaseImpl<EParamType::AddRem>::processCommand(const RlvCommand& rlvCmd, BhvrHandlerFunc* pHandler, BhvrToggleHandlerFunc* pToggleHandler)
diff --git a/indra/newview/rlvhelper.cpp b/indra/newview/rlvhelper.cpp
index 4a0b394acb..53f07b9bd3 100644
--- a/indra/newview/rlvhelper.cpp
+++ b/indra/newview/rlvhelper.cpp
@@ -62,6 +62,7 @@ BehaviourDictionary::BehaviourDictionary()
addEntry(new ForceProcessor<EBehaviour::Unsit>("unsit"));
addEntry(new ForceProcessor<EBehaviour::Attach>("attach"));
addEntry(new ForceProcessor<EBehaviour::AttachOver>("attachover"));
+ addEntry(new ForceProcessor<EBehaviour::Detach>("detach"));
// AddRem
addEntry(new BehaviourProcessor<EBehaviour::Sit>("sit"));