summaryrefslogtreecommitdiff
path: root/indra/newview/llagentwearables.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llagentwearables.cpp')
-rw-r--r--indra/newview/llagentwearables.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp
index 7f18ea6fe2..86bea2f58e 100644
--- a/indra/newview/llagentwearables.cpp
+++ b/indra/newview/llagentwearables.cpp
@@ -37,6 +37,7 @@
#include "llgesturemgr.h"
#include "llinventorybridge.h"
#include "llinventoryfunctions.h"
+#include "llinventorymodelbackgroundfetch.h"
#include "llinventoryobserver.h"
#include "llinventorypanel.h"
#include "lllocaltextureobject.h"
@@ -1581,6 +1582,14 @@ void LLAgentWearables::editWearable(const LLUUID& item_id)
return;
}
+ if (!item->isFinished())
+ {
+ LL_WARNS() << "Tried to edit wearable that isn't loaded" << LL_ENDL;
+ // Restart fetch or put item to the front
+ LLInventoryModelBackgroundFetch::instance().start(item->getUUID(), false);
+ return;
+ }
+
LLViewerWearable* wearable = gAgentWearables.getWearableFromItemID(item_id);
if (!wearable)
{
@@ -1594,6 +1603,18 @@ void LLAgentWearables::editWearable(const LLUUID& item_id)
return;
}
+ S32 shape_count = gAgentWearables.getWearableCount(LLWearableType::WT_SHAPE);
+ S32 hair_count = gAgentWearables.getWearableCount(LLWearableType::WT_HAIR);
+ S32 eye_count = gAgentWearables.getWearableCount(LLWearableType::WT_EYES);
+ S32 skin_count = gAgentWearables.getWearableCount(LLWearableType::WT_SKIN);
+ if (!shape_count || !hair_count || !eye_count || !skin_count)
+ {
+ // Don't let user edit wearables if avatar is cloud due to missing parts.
+ // Let user edit wearables if avatar is cloud due to missing textures.
+ LL_WARNS() << "Cannot modify wearable. Avatar is cloud and missing parts." << LL_ENDL;
+ return;
+ }
+
const BOOL disable_camera_switch = LLWearableType::getDisableCameraSwitch(wearable->getType());
LLPanel* panel = LLFloaterSidePanelContainer::getPanel("appearance");
LLSidepanelAppearance::editWearable(wearable, panel, disable_camera_switch);