summaryrefslogtreecommitdiff
path: root/indra/newview/llpaneleditwearable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpaneleditwearable.cpp')
-rwxr-xr-xindra/newview/llpaneleditwearable.cpp44
1 files changed, 30 insertions, 14 deletions
diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp
index 19a86cdcea..9bd6007772 100755
--- a/indra/newview/llpaneleditwearable.cpp
+++ b/indra/newview/llpaneleditwearable.cpp
@@ -925,17 +925,17 @@ void LLPanelEditWearable::onCommitSexChange()
if (!isAgentAvatarValid()) return;
LLWearableType::EType type = mWearablePtr->getType();
- U32 index = gAgentWearables.getWearableIndex(mWearablePtr);
-
- if( !gAgentWearables.isWearableModifiable(type, index))
+ U32 index;
+ if( !gAgentWearables.getWearableIndex(mWearablePtr, index) ||
+ !gAgentWearables.isWearableModifiable(type, index))
{
- return;
+ return;
}
LLViewerVisualParam* param = static_cast<LLViewerVisualParam*>(gAgentAvatarp->getVisualParam( "male" ));
if( !param )
{
- return;
+ return;
}
bool is_new_sex_male = (gSavedSettings.getU32("AvatarSex") ? SEX_MALE : SEX_FEMALE) == SEX_MALE;
@@ -978,10 +978,17 @@ void LLPanelEditWearable::onTexturePickerCommit(const LLUICtrl* ctrl)
}
if (getWearable())
{
- U32 index = gAgentWearables.getWearableIndex(getWearable());
- gAgentAvatarp->setLocalTexture(entry->mTextureIndex, image, FALSE, index);
- LLVisualParamHint::requestHintUpdates();
- gAgentAvatarp->wearableUpdated(type);
+ U32 index;
+ if (gAgentWearables.getWearableIndex(getWearable(), index))
+ {
+ gAgentAvatarp->setLocalTexture(entry->mTextureIndex, image, FALSE, index);
+ LLVisualParamHint::requestHintUpdates();
+ gAgentAvatarp->wearableUpdated(type);
+ }
+ else
+ {
+ LL_WARNS() << "wearable not found in gAgentWearables" << LL_ENDL;
+ }
}
}
else
@@ -1058,7 +1065,12 @@ void LLPanelEditWearable::saveChanges(bool force_save_as)
return;
}
- U32 index = gAgentWearables.getWearableIndex(mWearablePtr);
+ U32 index;
+ if (!gAgentWearables.getWearableIndex(mWearablePtr, index))
+ {
+ LL_WARNS() << "wearable not found" << LL_ENDL;
+ return;
+ }
std::string new_name = mNameEditor->getText();
@@ -1574,6 +1586,12 @@ void LLPanelEditWearable::onInvisibilityCommit(LLCheckBoxCtrl* checkbox_ctrl, LL
LL_INFOS() << "onInvisibilityCommit, self " << this << " checkbox_ctrl " << checkbox_ctrl << LL_ENDL;
+ U32 index;
+ if (!gAgentWearables.getWearableIndex(getWearable(),index))
+ {
+ LL_WARNS() << "wearable not found" << LL_ENDL;
+ return;
+ }
bool new_invis_state = checkbox_ctrl->get();
if (new_invis_state)
{
@@ -1581,9 +1599,8 @@ void LLPanelEditWearable::onInvisibilityCommit(LLCheckBoxCtrl* checkbox_ctrl, LL
mPreviousAlphaTexture[te] = lto->getID();
LLViewerFetchedTexture* image = LLViewerTextureManager::getFetchedTexture( IMG_INVISIBLE );
- U32 index = gAgentWearables.getWearableIndex(getWearable());
- gAgentAvatarp->setLocalTexture(te, image, FALSE, index);
- gAgentAvatarp->wearableUpdated(getWearable()->getType());
+ gAgentAvatarp->setLocalTexture(te, image, FALSE, index);
+ gAgentAvatarp->wearableUpdated(getWearable()->getType());
}
else
{
@@ -1598,7 +1615,6 @@ void LLPanelEditWearable::onInvisibilityCommit(LLCheckBoxCtrl* checkbox_ctrl, LL
LLViewerFetchedTexture* image = LLViewerTextureManager::getFetchedTexture(prev_id);
if (!image) return;
- U32 index = gAgentWearables.getWearableIndex(getWearable());
gAgentAvatarp->setLocalTexture(te, image, FALSE, index);
gAgentAvatarp->wearableUpdated(getWearable()->getType());
}