summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llagentwearables.cpp1
-rw-r--r--indra/newview/llwearable.cpp10
-rw-r--r--indra/newview/llwearable.h4
3 files changed, 15 insertions, 0 deletions
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp
index b52b58f9e2..907b92d478 100644
--- a/indra/newview/llagentwearables.cpp
+++ b/indra/newview/llagentwearables.cpp
@@ -704,6 +704,7 @@ U32 LLAgentWearables::pushWearable(const EWearableType type, LLWearable *wearabl
void LLAgentWearables::wearableUpdated(LLWearable *wearable)
{
mAvatarObject->wearableUpdated(wearable->getType(), TRUE);
+ wearable->refreshName();
wearable->setLabelUpdated();
// Hack pt 2. If the wearable we just loaded has definition version 24,
diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp
index 3cb0ec4bad..0405b9d28b 100644
--- a/indra/newview/llwearable.cpp
+++ b/indra/newview/llwearable.cpp
@@ -1094,6 +1094,16 @@ void LLWearable::setLabelUpdated() const
gInventory.addChangedMask(LLInventoryObserver::LABEL, getItemID());
}
+void LLWearable::refreshName()
+{
+ LLUUID item_id = getItemID();
+ LLInventoryItem* item = gInventory.getItem(item_id);
+ if( item )
+ {
+ mName = item->getName();
+ }
+}
+
struct LLWearableSaveData
{
EWearableType mType;
diff --git a/indra/newview/llwearable.h b/indra/newview/llwearable.h
index 43ffa12420..82d388ab7e 100644
--- a/indra/newview/llwearable.h
+++ b/indra/newview/llwearable.h
@@ -133,6 +133,10 @@ public:
// Something happened that requires the wearable's label to be updated (e.g. worn/unworn).
void setLabelUpdated() const;
+ // the wearable was worn. make sure the name of the wearable object matches the LLViewerInventoryItem,
+ // not the wearable asset itself.
+ void refreshName();
+
private:
typedef std::map<S32, LLLocalTextureObject*> te_map_t;
typedef std::map<S32, LLVisualParam *> visual_param_index_map_t;