diff options
| author | AndreyL ProductEngine <alihatskiy@productengine.com> | 2017-02-03 21:06:14 +0200 | 
|---|---|---|
| committer | AndreyL ProductEngine <alihatskiy@productengine.com> | 2017-02-03 21:06:14 +0200 | 
| commit | 09c063947c5a7d6a6e1abd035b203eac671c68ff (patch) | |
| tree | 2b6f0255d550c62477aa46a59aec6ca3cfd94c6f | |
| parent | f8790210dd7824ac0cbe2ea54815c04908615609 (diff) | |
| parent | fd81f83f6b571b16369b7d581198285d5a8ec363 (diff) | |
Merged in lindenlab/viewer-bear
| -rw-r--r-- | indra/newview/llappearancemgr.cpp | 43 | 
1 files changed, 22 insertions, 21 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 046e829070..35d08c7ab1 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1246,31 +1246,32 @@ void LLWearableHoldingPattern::onWearableAssetFetch(LLViewerWearable *wearable)  				data.mWearable = wearable;  				use_count++;  			} -			else if (wearable->getPermissions().allowModifyBy(gAgent.getID())) +			else  			{ -				// We can't edit and do some other interactions with same asset twice, copy it -				LLViewerWearable* new_wearable = LLWearableList::instance().createCopy(wearable, wearable->getName()); -				data.mWearable = new_wearable; -				data.mAssetID = new_wearable->getAssetID(); - -				LLViewerInventoryItem* item = gInventory.getItem(data.mItemID); -				if (item) +				LLViewerInventoryItem* wearable_item = gInventory.getItem(data.mItemID); +				if (wearable_item && wearable_item->getPermissions().allowModifyBy(gAgentID))  				{ +					// We can't edit and do some other interactions with same asset twice, copy it +					LLViewerWearable* new_wearable = LLWearableList::instance().createCopy(wearable, wearable->getName()); +					data.mWearable = new_wearable; +					data.mAssetID = new_wearable->getAssetID(); +  					// Update existing inventory item -					item->setAssetUUID(new_wearable->getAssetID()); -					item->setTransactionID(new_wearable->getTransactionID()); -					gInventory.updateItem(item, LLInventoryObserver::INTERNAL); -					item->updateServer(FALSE); +					wearable_item->setAssetUUID(new_wearable->getAssetID()); +					wearable_item->setTransactionID(new_wearable->getTransactionID()); +					gInventory.updateItem(wearable_item, LLInventoryObserver::INTERNAL); +					wearable_item->updateServer(FALSE); + +					use_count++; +				} +				else +				{ +					// Note: technically a bug, LLViewerWearable can identify only one item id at a time, +					// yet we are tying it to multiple items here. +					// LLViewerWearable need to support more then one item. +					LL_WARNS() << "Same LLViewerWearable is used by multiple items! " << wearable->getAssetID() << LL_ENDL; +					data.mWearable = wearable;  				} -				use_count++; -			} -			else -			{ -				// Note: technically a bug, LLViewerWearable can identify only one item id at a time, -				// yet we are tying it to multiple items here. -				// LLViewerWearable need to support more then one item. -				LL_WARNS() << "Same LLViewerWearable is used by multiple items! " << wearable->getAssetID() << LL_ENDL; -				data.mWearable = wearable;  			}  		}  	}  | 
