diff options
Diffstat (limited to 'linden/indra/newview/lltooldraganddrop.cpp')
-rw-r--r-- | linden/indra/newview/lltooldraganddrop.cpp | 85 |
1 files changed, 84 insertions, 1 deletions
diff --git a/linden/indra/newview/lltooldraganddrop.cpp b/linden/indra/newview/lltooldraganddrop.cpp index efd8060..c99ccbf 100644 --- a/linden/indra/newview/lltooldraganddrop.cpp +++ b/linden/indra/newview/lltooldraganddrop.cpp | |||
@@ -1267,6 +1267,15 @@ void LLToolDragAndDrop::dropObject(LLViewerObject* raycast_target, | |||
1267 | return; | 1267 | return; |
1268 | } | 1268 | } |
1269 | 1269 | ||
1270 | |||
1271 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
1272 | // Fallback in case there's a new code path that leads here (see behaviour notes) | ||
1273 | if (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) | ||
1274 | { | ||
1275 | return; | ||
1276 | } | ||
1277 | // [/RLVa:KB] | ||
1278 | |||
1270 | //llinfos << "Rezzing object" << llendl; | 1279 | //llinfos << "Rezzing object" << llendl; |
1271 | make_ui_sound("UISndObjectRezIn"); | 1280 | make_ui_sound("UISndObjectRezIn"); |
1272 | LLViewerInventoryItem* item; | 1281 | LLViewerInventoryItem* item; |
@@ -1933,6 +1942,23 @@ EAcceptance LLToolDragAndDrop::willObjectAcceptInventory(LLViewerObject* obj, LL | |||
1933 | BOOL volume = (LL_PCODE_VOLUME == obj->getPCode()); | 1942 | BOOL volume = (LL_PCODE_VOLUME == obj->getPCode()); |
1934 | BOOL attached = obj->isAttachment(); | 1943 | BOOL attached = obj->isAttachment(); |
1935 | BOOL unrestricted = ((perm.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED) ? TRUE : FALSE; | 1944 | BOOL unrestricted = ((perm.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED) ? TRUE : FALSE; |
1945 | |||
1946 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
1947 | if (rlv_handler_t::isEnabled()) | ||
1948 | { | ||
1949 | if (!gRlvHandler.isDetachable(obj)) | ||
1950 | { | ||
1951 | return ACCEPT_NO_LOCKED; // Disallow inventory drops on a locked attachment | ||
1952 | } | ||
1953 | else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SITTP)) ) | ||
1954 | { | ||
1955 | LLVOAvatar* pAvatar = gAgent.getAvatarObject(); | ||
1956 | if ( (pAvatar) && (pAvatar->mIsSitting) && (pAvatar->getRoot() == obj->getRootEdit()) ) | ||
1957 | return ACCEPT_NO_LOCKED; // ... or on a linkset the avie is sitting on under @unsit=n/@sittp=n | ||
1958 | } | ||
1959 | } | ||
1960 | // [/RLVa:KB] | ||
1961 | |||
1936 | if(attached && !unrestricted) | 1962 | if(attached && !unrestricted) |
1937 | { | 1963 | { |
1938 | return ACCEPT_NO_LOCKED; | 1964 | return ACCEPT_NO_LOCKED; |
@@ -1988,6 +2014,15 @@ EAcceptance LLToolDragAndDrop::dad3dRezAttachmentFromInv( | |||
1988 | return ACCEPT_NO; | 2014 | return ACCEPT_NO; |
1989 | } | 2015 | } |
1990 | 2016 | ||
2017 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-1.0.0c | ||
2018 | LLViewerJointAttachment* pAttachPt = NULL; | ||
2019 | if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) && (!RlvSettings::getEnableWear()) && | ||
2020 | ( ((pAttachPt = gRlvHandler.getAttachPoint(item, true)) == NULL) || (!gRlvHandler.isDetachable(pAttachPt->getObject())) ) ) | ||
2021 | { | ||
2022 | return ACCEPT_NO_LOCKED; | ||
2023 | } | ||
2024 | // [/RLVa:KB] | ||
2025 | |||
1991 | if( drop ) | 2026 | if( drop ) |
1992 | { | 2027 | { |
1993 | if(mSource == SOURCE_LIBRARY) | 2028 | if(mSource == SOURCE_LIBRARY) |
@@ -2003,7 +2038,10 @@ EAcceptance LLToolDragAndDrop::dad3dRezAttachmentFromInv( | |||
2003 | } | 2038 | } |
2004 | else | 2039 | else |
2005 | { | 2040 | { |
2006 | rez_attachment(item, 0); | 2041 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Added: RLVa-1.0.0c |
2042 | rez_attachment(item, pAttachPt); | ||
2043 | // [/RLVa:KB] | ||
2044 | //rez_attachment(item, 0); | ||
2007 | } | 2045 | } |
2008 | } | 2046 | } |
2009 | return ACCEPT_YES_SINGLE; | 2047 | return ACCEPT_YES_SINGLE; |
@@ -2013,6 +2051,13 @@ EAcceptance LLToolDragAndDrop::dad3dRezAttachmentFromInv( | |||
2013 | EAcceptance LLToolDragAndDrop::dad3dRezObjectOnLand( | 2051 | EAcceptance LLToolDragAndDrop::dad3dRezObjectOnLand( |
2014 | LLViewerObject* obj, S32 face, MASK mask, BOOL drop) | 2052 | LLViewerObject* obj, S32 face, MASK mask, BOOL drop) |
2015 | { | 2053 | { |
2054 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
2055 | if (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) | ||
2056 | { | ||
2057 | return ACCEPT_NO_LOCKED; | ||
2058 | } | ||
2059 | // [/RLVa:KB] | ||
2060 | |||
2016 | if (mSource == SOURCE_WORLD) | 2061 | if (mSource == SOURCE_WORLD) |
2017 | { | 2062 | { |
2018 | return dad3dRezFromObjectOnLand(obj, face, mask, drop); | 2063 | return dad3dRezFromObjectOnLand(obj, face, mask, drop); |
@@ -2076,6 +2121,14 @@ EAcceptance LLToolDragAndDrop::dad3dRezObjectOnLand( | |||
2076 | EAcceptance LLToolDragAndDrop::dad3dRezObjectOnObject( | 2121 | EAcceptance LLToolDragAndDrop::dad3dRezObjectOnObject( |
2077 | LLViewerObject* obj, S32 face, MASK mask, BOOL drop) | 2122 | LLViewerObject* obj, S32 face, MASK mask, BOOL drop) |
2078 | { | 2123 | { |
2124 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
2125 | // NOTE: if (mask & MASK_CONTROL) then it's a drop rather than a rez, so we let that pass through | ||
2126 | if ( !(mask & MASK_CONTROL) && (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) | ||
2127 | { | ||
2128 | return ACCEPT_NO_LOCKED; | ||
2129 | } | ||
2130 | // [/RLVa:KB] | ||
2131 | |||
2079 | // handle objects coming from object inventory | 2132 | // handle objects coming from object inventory |
2080 | if (mSource == SOURCE_WORLD) | 2133 | if (mSource == SOURCE_WORLD) |
2081 | { | 2134 | { |
@@ -2281,6 +2334,20 @@ EAcceptance LLToolDragAndDrop::dad3dWearItem( | |||
2281 | return ACCEPT_NO; | 2334 | return ACCEPT_NO; |
2282 | } | 2335 | } |
2283 | 2336 | ||
2337 | // [RLVa:KB] - Checked: 2009-07-07 (RLVa-1.0.0d) | ||
2338 | // (See behaviour notes for the "code path", this is just to give a visual indication on whether or not the drop is allowed) | ||
2339 | if (rlv_handler_t::isEnabled()) | ||
2340 | { | ||
2341 | EWearableType type = (EWearableType)item->getFlags(); | ||
2342 | |||
2343 | // Block if: 1) we can't wear on that layer; 2) or if we're already wearing something there we can't take off | ||
2344 | if ( (!gRlvHandler.isWearable(type)) || ((gAgent.getWearable(type)) && (!gRlvHandler.isRemovable(type))) ) | ||
2345 | { | ||
2346 | return ACCEPT_NO_LOCKED; | ||
2347 | } | ||
2348 | } | ||
2349 | // [/RLVa:KB] | ||
2350 | |||
2284 | if( drop ) | 2351 | if( drop ) |
2285 | { | 2352 | { |
2286 | // Don't wear anything until initial wearables are loaded, can | 2353 | // Don't wear anything until initial wearables are loaded, can |
@@ -2645,6 +2712,14 @@ EAcceptance LLToolDragAndDrop::dad3dGiveInventoryCategory( | |||
2645 | EAcceptance LLToolDragAndDrop::dad3dRezFromObjectOnLand( | 2712 | EAcceptance LLToolDragAndDrop::dad3dRezFromObjectOnLand( |
2646 | LLViewerObject* obj, S32 face, MASK mask, BOOL drop) | 2713 | LLViewerObject* obj, S32 face, MASK mask, BOOL drop) |
2647 | { | 2714 | { |
2715 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
2716 | // NOTE: it looks like this is only ever called from LLToolDragAndDrop::dad3dRezObjectOnLand() making this a bit redundant | ||
2717 | if (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) | ||
2718 | { | ||
2719 | return ACCEPT_NO_LOCKED; | ||
2720 | } | ||
2721 | // [/RLVa:KB] | ||
2722 | |||
2648 | lldebugs << "LLToolDragAndDrop::dad3dRezFromObjectOnLand()" << llendl; | 2723 | lldebugs << "LLToolDragAndDrop::dad3dRezFromObjectOnLand()" << llendl; |
2649 | LLViewerInventoryItem* item = NULL; | 2724 | LLViewerInventoryItem* item = NULL; |
2650 | LLViewerInventoryCategory* cat = NULL; | 2725 | LLViewerInventoryCategory* cat = NULL; |
@@ -2666,6 +2741,14 @@ EAcceptance LLToolDragAndDrop::dad3dRezFromObjectOnLand( | |||
2666 | EAcceptance LLToolDragAndDrop::dad3dRezFromObjectOnObject( | 2741 | EAcceptance LLToolDragAndDrop::dad3dRezFromObjectOnObject( |
2667 | LLViewerObject* obj, S32 face, MASK mask, BOOL drop) | 2742 | LLViewerObject* obj, S32 face, MASK mask, BOOL drop) |
2668 | { | 2743 | { |
2744 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
2745 | // NOTE: it looks like this is only ever called from LLToolDragAndDrop::dad3dRezObjectOnObject) making this a bit redundant | ||
2746 | if (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) | ||
2747 | { | ||
2748 | return ACCEPT_NO_LOCKED; | ||
2749 | } | ||
2750 | // [/RLVa:KB] | ||
2751 | |||
2669 | lldebugs << "LLToolDragAndDrop::dad3dRezFromObjectOnObject()" << llendl; | 2752 | lldebugs << "LLToolDragAndDrop::dad3dRezFromObjectOnObject()" << llendl; |
2670 | LLViewerInventoryItem* item; | 2753 | LLViewerInventoryItem* item; |
2671 | LLViewerInventoryCategory* cat; | 2754 | LLViewerInventoryCategory* cat; |