summaryrefslogtreecommitdiff
path: root/indra/newview/llagentwearables.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-08-24 18:44:39 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-08-24 18:44:39 +0100
commit98cc2365034a93c69704daa69efb389799cc9627 (patch)
tree4c3ec75b78a26a736f18a2153af025040ae05a4b /indra/newview/llagentwearables.cpp
parent6ba23344c95157793af9e4154933ae8df61630e8 (diff)
Backed out changeset a62bf7c0af21
Backing out this merge that I pushed (prematurely) to the wrong place.
Diffstat (limited to 'indra/newview/llagentwearables.cpp')
-rw-r--r--indra/newview/llagentwearables.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp
index 4c2caae2c6..a1ce556458 100644
--- a/indra/newview/llagentwearables.cpp
+++ b/indra/newview/llagentwearables.cpp
@@ -382,9 +382,7 @@ void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32
const std::string new_name)
{
LLWearable* old_wearable = getWearable(type, index);
- if(!old_wearable) return;
- bool name_changed = !new_name.empty() && (new_name != old_wearable->getName());
- if (name_changed || old_wearable->isDirty() || old_wearable->isOldVersion())
+ if (old_wearable && (old_wearable->isDirty() || old_wearable->isOldVersion()))
{
LLUUID old_item_id = old_wearable->getItemID();
LLWearable* new_wearable = LLWearableList::instance().createCopy(old_wearable);
@@ -400,10 +398,12 @@ void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32
if (item)
{
std::string item_name = item->getName();
- if (name_changed)
+ bool name_changed = false;
+ if (!new_name.empty() && (new_name != item->getName()))
{
llinfos << "saveWearable changing name from " << item->getName() << " to " << new_name << llendl;
item_name = new_name;
+ name_changed = true;
}
// Update existing inventory item
LLPointer<LLViewerInventoryItem> template_item =
@@ -1750,7 +1750,7 @@ void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj
LLViewerObject *objectp = (*attachment_iter);
if (objectp)
{
- LLUUID object_item_id = objectp->getAttachmentItemID();
+ LLUUID object_item_id = objectp->getItemID();
if (requested_item_ids.find(object_item_id) != requested_item_ids.end())
{
// Object currently worn, was requested.
@@ -1879,7 +1879,10 @@ void LLAgentWearables::userAttachMultipleAttachments(LLInventoryModel::item_arra
msg->nextBlockFast(_PREHASH_ObjectData );
msg->addUUIDFast(_PREHASH_ItemID, item->getLinkedUUID());
msg->addUUIDFast(_PREHASH_OwnerID, item->getPermissions().getOwner());
- msg->addU8Fast(_PREHASH_AttachmentPt, 0 ); // Wear at the previous or default attachment point
+ if (gSavedSettings.getBOOL("MultipleAttachments"))
+ msg->addU8Fast(_PREHASH_AttachmentPt, 0 | ATTACHMENT_ADD );
+ else
+ msg->addU8Fast(_PREHASH_AttachmentPt, 0 ); // Wear at the previous or default attachment point
pack_permissions_slam(msg, item->getFlags(), item->getPermissions());
msg->addStringFast(_PREHASH_Name, item->getName());
msg->addStringFast(_PREHASH_Description, item->getDescription());