From 6aa63dce3367a60a5f8ae58d0651844ec7a0a79e Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 5 Mar 2015 16:17:45 -0500 Subject: SL-103 WIP - viewer enforces wearable limits based on total articles of clothing rather than per-type limit. Limit is artificially low for testing, will bump before release. --- indra/newview/llagentwearables.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'indra/newview/llagentwearables.cpp') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index f06ffb4fb3..5589ab4aa7 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -633,10 +633,13 @@ void LLAgentWearables::wearableUpdated(LLWearable *wearable, BOOL removed) // the versions themselves are compatible. This code can be removed before release. if( wearable->getDefinitionVersion() == 24 ) { - wearable->setDefinitionVersion(22); - U32 index = getWearableIndex(wearable); - LL_INFOS() << "forcing wearable type " << wearable->getType() << " to version 22 from 24" << LL_ENDL; - saveWearable(wearable->getType(),index); + U32 index; + if (getWearableIndex(wearable,index)) + { + LL_INFOS() << "forcing wearable type " << wearable->getType() << " to version 22 from 24" << LL_ENDL; + wearable->setDefinitionVersion(22); + saveWearable(wearable->getType(),index); + } } checkWearableAgainstInventory(viewer_wearable); @@ -949,7 +952,7 @@ void LLAgentWearables::removeWearableFinal(const LLWearableType::EType type, boo LLViewerWearable* old_wearable = getViewerWearable(type,i); if (old_wearable) { - popWearable(old_wearable); + eraseWearable(old_wearable); old_wearable->removeFromAvatar(); } } @@ -961,7 +964,7 @@ void LLAgentWearables::removeWearableFinal(const LLWearableType::EType type, boo if (old_wearable) { - popWearable(old_wearable); + eraseWearable(old_wearable); old_wearable->removeFromAvatar(); } } @@ -1163,7 +1166,13 @@ bool LLAgentWearables::onSetWearableDialog(const LLSD& notification, const LLSD& { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); LLInventoryItem* new_item = gInventory.getItem(notification["payload"]["item_id"].asUUID()); - U32 index = gAgentWearables.getWearableIndex(wearable); + U32 index; + if (!gAgentWearables.getWearableIndex(wearable,index)) + { + LL_WARNS() << "Wearable not found" << LL_ENDL; + delete wearable; + return false; + } if (!new_item) { delete wearable; -- cgit v1.2.3