From 23d5c59f6833156ee0714ecfba8194dd8708c730 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Tue, 6 Oct 2009 22:12:05 -0700 Subject: Applied RLVa-1.0.2c_20091005_Imprudence-1.2.0-diff.patch --- linden/indra/newview/llinventorybridge.cpp | 6 +- linden/indra/newview/lltooldraganddrop.cpp | 4 +- linden/indra/newview/llviewermenu.cpp | 12 ++-- linden/indra/newview/llviewermessage.cpp | 10 ++- linden/indra/newview/rlvhandler.cpp | 104 ++++++++++------------------- linden/indra/newview/rlvhandler.h | 9 +++ linden/indra/newview/rlvhelper.cpp | 9 ++- linden/indra/newview/rlvhelper.h | 78 +++++++++++----------- 8 files changed, 104 insertions(+), 128 deletions(-) (limited to 'linden/indra') diff --git a/linden/indra/newview/llinventorybridge.cpp b/linden/indra/newview/llinventorybridge.cpp index 618c4f9..0d5625c 100644 --- a/linden/indra/newview/llinventorybridge.cpp +++ b/linden/indra/newview/llinventorybridge.cpp @@ -3505,7 +3505,7 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) if ( (rlv_handler_t::isEnabled()) && (!RlvSettings::getEnableWear()) && (gRlvHandler.hasLockedAttachment()) ) { LLViewerJointAttachment* pAttachPt = gRlvHandler.getAttachPoint(item, true); - if ( (!pAttachPt) || (!gRlvHandler.isDetachable(pAttachPt->getObject())) ) + if ( (!pAttachPt) || (!gRlvHandler.isDetachable(pAttachPt)) ) disabled_items.push_back(std::string("Object Wear")); } // [/RLVa:KB] @@ -4057,7 +4057,7 @@ void wear_inventory_category_on_avatar_step2( BOOL proceed, void* userdata ) for (S32 idxObj = obj_item_array.count() - 1; idxObj >= 0; idxObj--) { LLViewerJointAttachment* pAttachPt = gRlvHandler.getAttachPoint(obj_item_array.get(idxObj).get(), true); - if ( ((!pAttachPt) || (!gRlvHandler.isDetachable(pAttachPt->getObject()))) ) + if ( ((!pAttachPt) || (!gRlvHandler.isDetachable(pAttachPt))) ) obj_item_array.remove(idxObj); } obj_count = obj_item_array.count(); @@ -4245,7 +4245,7 @@ void wear_attachments_on_avatar(const std::set& item_ids, BOOL remove) // [RLVa:KB] - Checked: 2009-09-11 (RLVa-1.0.2c) | Modified: RLVa-1.0.2c LLViewerJointAttachment* pAttachPt = NULL; if ( (!rlv_handler_t::isEnabled()) || (RlvSettings::getEnableWear()) || (!gRlvHandler.hasLockedAttachment()) || - (((pAttachPt = gRlvHandler.getAttachPoint(item, true)) != NULL) && (gRlvHandler.isDetachable(pAttachPt->getObject()))) ) + (((pAttachPt = gRlvHandler.getAttachPoint(item, true)) != NULL) && (gRlvHandler.isDetachable(pAttachPt))) ) { items.put(item); } diff --git a/linden/indra/newview/lltooldraganddrop.cpp b/linden/indra/newview/lltooldraganddrop.cpp index c99ccbf..178bde6 100644 --- a/linden/indra/newview/lltooldraganddrop.cpp +++ b/linden/indra/newview/lltooldraganddrop.cpp @@ -2014,10 +2014,10 @@ EAcceptance LLToolDragAndDrop::dad3dRezAttachmentFromInv( return ACCEPT_NO; } -// [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-1.0.0c +// [RLVa:KB] - Checked: 2009-09-08 (RLVa-1.0.2c) | Modified: RLVa-1.0.2c LLViewerJointAttachment* pAttachPt = NULL; if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) && (!RlvSettings::getEnableWear()) && - ( ((pAttachPt = gRlvHandler.getAttachPoint(item, true)) == NULL) || (!gRlvHandler.isDetachable(pAttachPt->getObject())) ) ) + ( ((pAttachPt = gRlvHandler.getAttachPoint(item, true)) == NULL) || (!gRlvHandler.isDetachable(pAttachPt)) ) ) { return ACCEPT_NO_LOCKED; } diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index d11bc02..98dd0ea 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp @@ -6045,9 +6045,9 @@ private: // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) if ( (rlv_handler_t::isEnabled()) && - ( ((index == 0) && (gRlvHandler.hasLockedAttachment())) || // Can't wear on default attach point - ((index > 0) && (!gRlvHandler.isDetachable(attachment_point->getObject()))) || // Can't replace locked attachment - (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) ) // Attach on rezzed object == "Take" + ( ((index == 0) && (gRlvHandler.hasLockedAttachment())) || // Can't wear on default attach point + ((index > 0) && (!gRlvHandler.isDetachable(attachment_point))) || // Can't replace locked attachment + (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) ) // Attach on rezzed object == "Take" { setObjectSelection(NULL); // Clear the selection or it'll get stuck return true; @@ -6449,9 +6449,9 @@ BOOL object_selected_and_point_valid(void *user_data) // - enabler set up in LLVOAvatar::buildCharacter() => Rezzed prim / right-click / "Attach >" [user_data == pAttachPt] // - enabler set up in LLVOAvatar::buildCharacter() => Rezzed prim / Edit menu / "Attach Object" [user_data == pAttachPt] LLViewerJointAttachment* pAttachPt = (LLViewerJointAttachment*)user_data; - if ( ((!pAttachPt) && (gRlvHandler.hasLockedAttachment())) || // Don't allow attach to default attach point - ((pAttachPt) && (!gRlvHandler.isDetachable(pAttachPt->getObject()))) || // Don't allow replacing of locked attachment - (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) // Attaching a rezzed object == "Take" + if ( ((!pAttachPt) && (gRlvHandler.hasLockedAttachment())) || // Don't allow attach to default attach point + ((pAttachPt) && (!gRlvHandler.isDetachable(pAttachPt))) || // Don't allow replacing of locked attachment + (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) // Attaching a rezzed object == "Take" { return FALSE; } diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index cecef95..33d3d51 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp @@ -2579,18 +2579,16 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) verb = " " + LLTrans::getString("whisper") + " "; break; case CHAT_TYPE_OWNER: -// [RLVa:KB] - Checked: 2009-08-05 (RLVa-1.0.1e) | Modified: RLVa-1.0.1e - if ( (rlv_handler_t::isEnabled()) && (mesg.length() > 3) && (RLV_CMD_PREFIX == mesg[0]) ) +// [RLVa:KB] - Checked: 2009-08-28 (RLVa-1.0.2a) | Modified: RLVa-1.0.2a + if ( (rlv_handler_t::isEnabled()) && (mesg.length() > 3) && (RLV_CMD_PREFIX == mesg[0]) && (CHAT_TYPE_OWNER == chat.mChatType) ) { mesg.erase(0, 1); LLStringUtil::toLower(mesg); std::string strExecuted, strFailed, strRetained, *pstr; - typedef boost::tokenizer > tokenizer; - boost::char_separator sep(",", "", boost::drop_empty_tokens); - tokenizer tokens(mesg, sep); - for (tokenizer::iterator itToken = tokens.begin(); itToken != tokens.end(); ++itToken) + boost_tokenizer tokens(mesg, boost::char_separator(",", "", boost::drop_empty_tokens)); + for (boost_tokenizer::const_iterator itToken = tokens.begin(); itToken != tokens.end(); ++itToken) { if (LLStartUp::getStartupState() == STATE_STARTED) { diff --git a/linden/indra/newview/rlvhandler.cpp b/linden/indra/newview/rlvhandler.cpp index 2915002..987c62a 100644 --- a/linden/indra/newview/rlvhandler.cpp +++ b/linden/indra/newview/rlvhandler.cpp @@ -93,7 +93,7 @@ inline bool rlvIsWearingItem(const LLInventoryItem* pItem) static bool rlvParseNotifyOption(const std::string& strOption, S32& nChannel, std::string& strFilter) { boost_tokenizer tokens(strOption, boost::char_separator(";", "", boost::keep_empty_tokens)); - boost_tokenizer::iterator itTok = tokens.begin(); + boost_tokenizer::const_iterator itTok = tokens.begin(); // Extract and sanity check the first token (required) which is the channel if ( (itTok == tokens.end()) || (!LLStringUtil::convertToS32(*itTok, nChannel)) || (!rlvIsValidChannel(nChannel)) ) @@ -274,7 +274,7 @@ bool RlvHandler::isDetachableExcept(S32 idxAttachPt, LLViewerObject *pObj) const return true; } -// Checked: 2009-05-31 (RLVa-0.2.0e) | Modified: RLVa-0.2.0e +// Checked: 2009-09-06 (RLVa-1.0.2b) | Modified: RLVa-1.0.2b bool RlvHandler::setDetachable(S32 idxAttachPt, const LLUUID& idRlvObj, bool fDetachable) { // Sanity check - make sure it's an object we know about @@ -284,20 +284,12 @@ bool RlvHandler::setDetachable(S32 idxAttachPt, const LLUUID& idRlvObj, bool fDe if (!fDetachable) { - // Sanity check - make sure it's not already marked undetachable by this object (NOTE: m_Attachments is a *multimap*, not a map) - for (rlv_detach_map_t::const_iterator itAttach = m_Attachments.lower_bound(idxAttachPt), - endAttach = m_Attachments.upper_bound(idxAttachPt); itAttach != endAttach; ++itAttach) - { - if (itObj->second.m_UUID == itAttach->second) - return false; - } - + // NOTE: m_Attachments can contain duplicate pairs (ie @detach:spine=n,detach=n from an attachment on spine) m_Attachments.insert(std::pair(idxAttachPt, itObj->second.m_UUID)); return true; } else { - // NOTE: m_Attachments is a *multimap*, not a map for (rlv_detach_map_t::iterator itAttach = m_Attachments.lower_bound(idxAttachPt), endAttach = m_Attachments.upper_bound(idxAttachPt); itAttach != endAttach; ++itAttach) { @@ -325,11 +317,11 @@ bool RlvHandler::setDetachable(S32 idxAttachPt, const LLUUID& idRlvObj, bool fDe LLViewerInventoryItem* pItem = gInventory.getItem(idItem); if (pItem) { - if (-1 != pItem->getName().find(RLV_FOLDER_FLAG_NOSTRIP)) + if (std::string::npos != pItem->getName().find(RLV_FOLDER_FLAG_NOSTRIP)) return false; LLViewerInventoryCategory* pFolder = gInventory.getCategory(pItem->getParentUUID()); - if ( (pFolder) && (-1 != pFolder->getName().find(RLV_FOLDER_FLAG_NOSTRIP)) ) + if ( (pFolder) && (std::string::npos != pFolder->getName().find(RLV_FOLDER_FLAG_NOSTRIP)) ) return false; } } @@ -499,7 +491,7 @@ BOOL RlvHandler::processCommand(const LLUUID& uuid, const std::string& strCmd, b itCurCmd = itCmd++; // Point itCmd ahead so it won't get invalidated if/when we erase a command const RlvCommand& rlvCmdRem = *itCurCmd; - if ( (strFilter.empty()) || (-1 != rlvCmdRem.asString().find(strFilter)) ) + if ( (strFilter.empty()) || (std::string::npos != rlvCmdRem.asString().find(strFilter)) ) { fContinue = (rlvObj.m_Commands.size() > 1); // rlvObj will become invalid once we remove the last command strCmdRem = rlvCmdRem.getBehaviour() + ":" + rlvCmdRem.getOption() + "=y"; @@ -780,22 +772,15 @@ BOOL RlvHandler::processRemoveCommand(const LLUUID& uuid, const RlvCommand& rlvC { case RLV_BHVR_DETACH: // @detach[: