summaryrefslogtreecommitdiff
path: root/indra/newview/llagentwearables.cpp
diff options
context:
space:
mode:
authorsimon <none@none>2015-06-08 14:54:22 -0700
committersimon <none@none>2015-06-08 14:54:22 -0700
commit316bdc0ab04f8cfb587bbfbe0966963f7614cce2 (patch)
tree0f8e8ef231c7df1d2825adf9929c6b6f9a84f880 /indra/newview/llagentwearables.cpp
parent4647dc6fe7aacccf089d214bf26b47f417bd7ae6 (diff)
parentf3c58f765c0168f25bb13c4427e34b4bdad2f671 (diff)
Merge viewer-release and become version 3.7.30
Diffstat (limited to 'indra/newview/llagentwearables.cpp')
-rwxr-xr-xindra/newview/llagentwearables.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp
index f6ba879fa7..13b16f5218 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();
}
}
@@ -1180,7 +1183,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;