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 34831a2..c24dd78 100644 --- a/linden/indra/newview/lltooldraganddrop.cpp +++ b/linden/indra/newview/lltooldraganddrop.cpp | |||
@@ -1269,6 +1269,15 @@ void LLToolDragAndDrop::dropObject(LLViewerObject* raycast_target, | |||
1269 | return; | 1269 | return; |
1270 | } | 1270 | } |
1271 | 1271 | ||
1272 | |||
1273 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
1274 | // Fallback in case there's a new code path that leads here (see behaviour notes) | ||
1275 | if (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) | ||
1276 | { | ||
1277 | return; | ||
1278 | } | ||
1279 | // [/RLVa:KB] | ||
1280 | |||
1272 | //llinfos << "Rezzing object" << llendl; | 1281 | //llinfos << "Rezzing object" << llendl; |
1273 | make_ui_sound("UISndObjectRezIn"); | 1282 | make_ui_sound("UISndObjectRezIn"); |
1274 | LLViewerInventoryItem* item; | 1283 | LLViewerInventoryItem* item; |
@@ -1961,6 +1970,23 @@ EAcceptance LLToolDragAndDrop::willObjectAcceptInventory(LLViewerObject* obj, LL | |||
1961 | BOOL volume = (LL_PCODE_VOLUME == obj->getPCode()); | 1970 | BOOL volume = (LL_PCODE_VOLUME == obj->getPCode()); |
1962 | BOOL attached = obj->isAttachment(); | 1971 | BOOL attached = obj->isAttachment(); |
1963 | BOOL unrestricted = ((perm.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED) ? TRUE : FALSE; | 1972 | BOOL unrestricted = ((perm.getMaskBase() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED) ? TRUE : FALSE; |
1973 | |||
1974 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | ||
1975 | if (rlv_handler_t::isEnabled()) | ||
1976 | { | ||
1977 | if (!gRlvHandler.isDetachable(obj)) | ||
1978 | { | ||
1979 | return ACCEPT_NO_LOCKED; // Disallow inventory drops on a locked attachment | ||
1980 | } | ||
1981 | else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SITTP)) ) | ||
1982 | { | ||
1983 | LLVOAvatar* pAvatar = gAgent.getAvatarObject(); | ||
1984 | if ( (pAvatar) && (pAvatar->mIsSitting) && (pAvatar->getRoot() == obj->getRootEdit()) ) | ||
1985 | return ACCEPT_NO_LOCKED; // ... or on a linkset the avie is sitting on under @unsit=n/@sittp=n | ||
1986 | } | ||
1987 | } | ||
1988 | // [/RLVa:KB] | ||
1989 | |||
1964 | if(attached && !unrestricted) | 1990 | if(attached && !unrestricted) |
1965 | { | 1991 | { |
1966 | return ACCEPT_NO_LOCKED; | 1992 | return ACCEPT_NO_LOCKED; |
@@ -2092,6 +2118,15 @@ EAcceptance LLToolDragAndDrop::dad3dRezAttachmentFromInv( | |||
2092 | return ACCEPT_NO; | 2118 | return ACCEPT_NO; |
2093 | } | 2119 | } |
2094 | 2120 | ||
2121 | // [RLVa:KB] - Checked: 2009-09-08 (RLVa-1.0.2c) | Modified: RLVa-1.0.2c | ||
2122 | LLViewerJointAttachment* pAttachPt = NULL; | ||
2123 | if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) && (!RlvSettings::getEnableWear()) && | ||
2124 | ( ((pAttachPt = gRlvHandler.getAttachPoint(item, true)) == NULL) || (!gRlvHandler.isDetachable(pAttachPt)) ) ) | ||
2125 | { | ||
2126 | return ACCEPT_NO_LOCKED; | ||
2127 | } | ||
2128 | // [/RLVa:KB] | ||
2129 | |||
2095 | if( drop ) | 2130 | if( drop ) |
2096 | { | 2131 | { |
2097 | if(mSource == SOURCE_LIBRARY) | 2132 | if(mSource == SOURCE_LIBRARY) |
@@ -2107,7 +2142,10 @@ EAcceptance LLToolDragAndDrop::dad3dRezAttachmentFromInv( | |||
2107 | } | 2142 | } |
2108 | else | 2143 | else |
2109 | { | 2144 | { |
2110 | rez_attachment(item, 0); | 2145 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Added: RLVa-1.0.0c |
2146 | rez_attachment(item, pAttachPt); | ||
2147 | // [/RLVa:KB] | ||
2148 | //rez_attachment(item, 0); | ||
2111 | } | 2149 | } |
2112 | } | 2150 | } |
2113 | return ACCEPT_YES_SINGLE; | 2151 | return ACCEPT_YES_SINGLE; |
@@ -2117,6 +2155,13 @@ EAcceptance LLToolDragAndDrop::dad3dRezAttachmentFromInv( | |||
2117 | EAcceptance LLToolDragAndDrop::dad3dRezObjectOnLand( | 2155 | EAcceptance LLToolDragAndDrop::dad3dRezObjectOnLand( |
2118 | LLViewerObject* obj, S32 face, MASK mask, BOOL drop) | 2156 | LLViewerObject* obj, S32 face, MASK mask, BOOL drop) |
2119 | { | 2157 | { |
2158 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
2159 | if (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) | ||
2160 | { | ||
2161 | return ACCEPT_NO_LOCKED; | ||
2162 | } | ||
2163 | // [/RLVa:KB] | ||
2164 | |||
2120 | if (mSource == SOURCE_WORLD) | 2165 | if (mSource == SOURCE_WORLD) |
2121 | { | 2166 | { |
2122 | return dad3dRezFromObjectOnLand(obj, face, mask, drop); | 2167 | return dad3dRezFromObjectOnLand(obj, face, mask, drop); |
@@ -2180,6 +2225,14 @@ EAcceptance LLToolDragAndDrop::dad3dRezObjectOnLand( | |||
2180 | EAcceptance LLToolDragAndDrop::dad3dRezObjectOnObject( | 2225 | EAcceptance LLToolDragAndDrop::dad3dRezObjectOnObject( |
2181 | LLViewerObject* obj, S32 face, MASK mask, BOOL drop) | 2226 | LLViewerObject* obj, S32 face, MASK mask, BOOL drop) |
2182 | { | 2227 | { |
2228 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
2229 | // NOTE: if (mask & MASK_CONTROL) then it's a drop rather than a rez, so we let that pass through | ||
2230 | if ( !(mask & MASK_CONTROL) && (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) | ||
2231 | { | ||
2232 | return ACCEPT_NO_LOCKED; | ||
2233 | } | ||
2234 | // [/RLVa:KB] | ||
2235 | |||
2183 | // handle objects coming from object inventory | 2236 | // handle objects coming from object inventory |
2184 | if (mSource == SOURCE_WORLD) | 2237 | if (mSource == SOURCE_WORLD) |
2185 | { | 2238 | { |
@@ -2385,6 +2438,20 @@ EAcceptance LLToolDragAndDrop::dad3dWearItem( | |||
2385 | return ACCEPT_NO; | 2438 | return ACCEPT_NO; |
2386 | } | 2439 | } |
2387 | 2440 | ||
2441 | // [RLVa:KB] - Checked: 2009-07-07 (RLVa-1.0.0d) | ||
2442 | // (See behaviour notes for the "code path", this is just to give a visual indication on whether or not the drop is allowed) | ||
2443 | if (rlv_handler_t::isEnabled()) | ||
2444 | { | ||
2445 | EWearableType type = (EWearableType)item->getFlags(); | ||
2446 | |||
2447 | // Block if: 1) we can't wear on that layer; 2) or if we're already wearing something there we can't take off | ||
2448 | if ( (!gRlvHandler.isWearable(type)) || ((gAgent.getWearable(type)) && (!gRlvHandler.isRemovable(type))) ) | ||
2449 | { | ||
2450 | return ACCEPT_NO_LOCKED; | ||
2451 | } | ||
2452 | } | ||
2453 | // [/RLVa:KB] | ||
2454 | |||
2388 | if( drop ) | 2455 | if( drop ) |
2389 | { | 2456 | { |
2390 | // Don't wear anything until initial wearables are loaded, can | 2457 | // Don't wear anything until initial wearables are loaded, can |
@@ -2749,6 +2816,14 @@ EAcceptance LLToolDragAndDrop::dad3dGiveInventoryCategory( | |||
2749 | EAcceptance LLToolDragAndDrop::dad3dRezFromObjectOnLand( | 2816 | EAcceptance LLToolDragAndDrop::dad3dRezFromObjectOnLand( |
2750 | LLViewerObject* obj, S32 face, MASK mask, BOOL drop) | 2817 | LLViewerObject* obj, S32 face, MASK mask, BOOL drop) |
2751 | { | 2818 | { |
2819 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
2820 | // NOTE: it looks like this is only ever called from LLToolDragAndDrop::dad3dRezObjectOnLand() making this a bit redundant | ||
2821 | if (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) | ||
2822 | { | ||
2823 | return ACCEPT_NO_LOCKED; | ||
2824 | } | ||
2825 | // [/RLVa:KB] | ||
2826 | |||
2752 | lldebugs << "LLToolDragAndDrop::dad3dRezFromObjectOnLand()" << llendl; | 2827 | lldebugs << "LLToolDragAndDrop::dad3dRezFromObjectOnLand()" << llendl; |
2753 | LLViewerInventoryItem* item = NULL; | 2828 | LLViewerInventoryItem* item = NULL; |
2754 | LLViewerInventoryCategory* cat = NULL; | 2829 | LLViewerInventoryCategory* cat = NULL; |
@@ -2770,6 +2845,14 @@ EAcceptance LLToolDragAndDrop::dad3dRezFromObjectOnLand( | |||
2770 | EAcceptance LLToolDragAndDrop::dad3dRezFromObjectOnObject( | 2845 | EAcceptance LLToolDragAndDrop::dad3dRezFromObjectOnObject( |
2771 | LLViewerObject* obj, S32 face, MASK mask, BOOL drop) | 2846 | LLViewerObject* obj, S32 face, MASK mask, BOOL drop) |
2772 | { | 2847 | { |
2848 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | ||
2849 | // NOTE: it looks like this is only ever called from LLToolDragAndDrop::dad3dRezObjectOnObject) making this a bit redundant | ||
2850 | if (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) | ||
2851 | { | ||
2852 | return ACCEPT_NO_LOCKED; | ||
2853 | } | ||
2854 | // [/RLVa:KB] | ||
2855 | |||
2773 | lldebugs << "LLToolDragAndDrop::dad3dRezFromObjectOnObject()" << llendl; | 2856 | lldebugs << "LLToolDragAndDrop::dad3dRezFromObjectOnObject()" << llendl; |
2774 | LLViewerInventoryItem* item; | 2857 | LLViewerInventoryItem* item; |
2775 | LLViewerInventoryCategory* cat; | 2858 | LLViewerInventoryCategory* cat; |