summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llagentwearables.cpp25
-rw-r--r--indra/newview/llagentwearables.h1
-rw-r--r--indra/newview/llwearable.cpp12
-rw-r--r--indra/newview/llwearable.h2
4 files changed, 25 insertions, 15 deletions
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp
index cfa3f4ae02..574b449d23 100644
--- a/indra/newview/llagentwearables.cpp
+++ b/indra/newview/llagentwearables.cpp
@@ -675,7 +675,7 @@ void LLAgentWearables::setWearable(const EWearableType type, U32 index, LLWearab
{
wearable_vec[index] = wearable;
old_wearable->setLabelUpdated();
- mAvatarObject->wearableUpdated(wearable->getType());
+ wearableUpdated(wearable);
}
}
@@ -690,13 +690,32 @@ U32 LLAgentWearables::pushWearable(const EWearableType type, LLWearable *wearabl
if (type < WT_COUNT || mWearableDatas[type].size() < MAX_WEARABLES_PER_TYPE)
{
mWearableDatas[type].push_back(wearable);
- mAvatarObject->wearableUpdated(wearable->getType());
- wearable->setLabelUpdated();
+ wearableUpdated(wearable);
return mWearableDatas[type].size()-1;
}
return MAX_WEARABLES_PER_TYPE;
}
+void LLAgentWearables::wearableUpdated(LLWearable *wearable)
+{
+ mAvatarObject->wearableUpdated(wearable->getType());
+ wearable->setLabelUpdated();
+
+ // Hack pt 2. If the wearable we just loaded has definition version 24,
+ // then force a re-save of this wearable after slamming the version number to 22.
+ // This number was incorrectly incremented for internal builds before release, and
+ // this fix will ensure that the affected wearables are re-saved with the right version number.
+ // the versions themselves are compatible. This code can be removed before release.
+ if( wearable->getDefinitionVersion() == 24 )
+ {
+ wearable->setDefinitionVersion(22);
+ U32 index = getWearableIndex(wearable);
+ llinfos << "forcing werable type " << wearable->getType() << " to version 22 from 24" << llendl;
+ saveWearable(wearable->getType(),index,TRUE);
+ }
+
+}
+
void LLAgentWearables::popWearable(LLWearable *wearable)
{
if (wearable == NULL)
diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h
index 8f3a16501e..b4f58674af 100644
--- a/indra/newview/llagentwearables.h
+++ b/indra/newview/llagentwearables.h
@@ -107,6 +107,7 @@ private:
// Low-level data structure setter - public access is via setWearableItem, etc.
void setWearable(const EWearableType type, U32 index, LLWearable *wearable);
U32 pushWearable(const EWearableType type, LLWearable *wearable);
+ void wearableUpdated(LLWearable *wearable);
void popWearable(LLWearable *wearable);
void popWearable(const EWearableType type, U32 index);
diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp
index ced0b64896..d92da4ef44 100644
--- a/indra/newview/llwearable.cpp
+++ b/indra/newview/llwearable.cpp
@@ -421,18 +421,6 @@ BOOL LLWearable::importFile( LLFILE* file )
// copy all saved param values to working params
revertValues();
- // Hack pt 2. If the wearable we just loaded has definition version 24,
- // then force a re-save of this wearable after slamming the version number to 22.
- // This number was incorrectly incremented for internal builds before release, and
- // this fix will ensure that the affected wearables are re-saved with the right version number.
- // the versions themselves are compatible. This code can be removed before release.
- if( mDefinitionVersion == 24 )
- {
- mDefinitionVersion = 22;
- U32 index = gAgentWearables.getWearableIndex(this);
- gAgentWearables.saveWearable(mType,index,TRUE);
- }
-
return TRUE;
}
diff --git a/indra/newview/llwearable.h b/indra/newview/llwearable.h
index 0863adb7f5..43ffa12420 100644
--- a/indra/newview/llwearable.h
+++ b/indra/newview/llwearable.h
@@ -82,6 +82,8 @@ public:
const std::string& getTypeName() const;
LLAssetType::EType getAssetType() const;
LLLocalTextureObject* getLocalTextureObject(S32 index) const;
+ S32 getDefinitionVersion() const { return mDefinitionVersion; }
+ void setDefinitionVersion( S32 new_version ) { mDefinitionVersion = new_version; }
public:
typedef std::vector<LLVisualParam*> visual_param_vec_t;