From 8244288323549c59708a7092139ebba77382d911 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Fri, 11 Sep 2009 15:06:18 +0000 Subject: For DEV-39666 : Ensure AgentWearables saves actual items, not links, to database For backwards compatibility, this change ensures that links aren't saved to user_wearable. Reviewed by: Vir. --- indra/newview/llagentwearables.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 54b94482de..c4e01808f7 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -311,7 +311,15 @@ void LLAgentWearables::sendAgentWearablesUpdate() if (wearable) { //llinfos << "Sending wearable " << wearable->getName() << llendl; - gMessageSystem->addUUIDFast(_PREHASH_ItemID, wearable->getItemID()); + LLUUID item_id = wearable->getItemID(); + const LLViewerInventoryItem *item = gInventory.getItem(item_id); + if (item && item->getIsLinkType()) + { + // Get the itemID that this item points to. i.e. make sure + // we are storing baseitems, not their links, in the database. + item_id = item->getLinkedUUID(); + } + gMessageSystem->addUUIDFast(_PREHASH_ItemID, item_id); } else { -- cgit v1.2.3