summaryrefslogtreecommitdiff
path: root/indra/newview/llagentwearables.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2015-05-27 11:08:45 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2015-05-27 11:08:45 -0400
commit9e3eb8991d54a39dc3d4c99739fa1a411ed64b35 (patch)
treec96c00d9847ac5ea8edc33835dd634a0829c0e23 /indra/newview/llagentwearables.cpp
parente2544fabe5f63201ca11102aa9b4266cb62211bd (diff)
parentf3c58f765c0168f25bb13c4427e34b4bdad2f671 (diff)
merge
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 d772e1c7f8..06b86e311a 100755
--- a/indra/newview/llagentwearables.cpp
+++ b/indra/newview/llagentwearables.cpp
@@ -634,10 +634,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);
@@ -950,7 +953,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();
}
}
@@ -962,7 +965,7 @@ void LLAgentWearables::removeWearableFinal(const LLWearableType::EType type, boo
if (old_wearable)
{
- popWearable(old_wearable);
+ eraseWearable(old_wearable);
old_wearable->removeFromAvatar();
}
}
@@ -1164,7 +1167,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;