diff options
| author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2010-01-05 16:26:17 -0500 | 
|---|---|---|
| committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2010-01-05 16:26:17 -0500 | 
| commit | 09326838c5f63057dc8f692c9cb100bf5f99e8e0 (patch) | |
| tree | fec21b4e0fd298f028c1a7f12fbac62e33ea0d18 | |
| parent | b282f04b31f60a3ddd9dcbd27eed2d2226a40e09 (diff) | |
For EXT-3923: added additional warnings to catch corrupted wearables in inventory
| -rw-r--r-- | indra/newview/llagentwearables.cpp | 37 | 
1 files changed, 37 insertions, 0 deletions
| diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index dc1598aacd..dd19bbac2e 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -116,6 +116,39 @@ BOOL LLAgentWearables::mInitialWearablesUpdateReceived = FALSE;  using namespace LLVOAvatarDefines; +// HACK: For EXT-3923: Pants item shows in inventory with skin icon and messes with "current look" +// Some db items are corrupted, have inventory flags = 0, implying wearable type = shape, even though +// wearable type stored in asset is some other value. +// Calling this function whenever a wearable is added to increase visibility if this problem +// turns up in other inventories. +void checkWearableAgainstInventory(LLWearable *wearable) +{ +	if (wearable->getItemID().isNull()) +		return; +	 +	// Check for wearable type consistent with inventory item wearable type. +	LLViewerInventoryItem *item = gInventory.getItem(wearable->getItemID()); +	if (item) +	{ +		if (!item->isWearableType()) +		{ +			llwarns << "wearable associated with non-wearable item" << llendl; +		} +		if (item->getWearableType() != wearable->getType()) +		{ +			llwarns << "type mismatch: wearable " << wearable->getName() +					<< " has type " << wearable->getType() +					<< " but inventory item " << item->getName() +					<< " has type "  << item->getWearableType() << llendl; +		} +	} +	else +	{ +		llwarns << "wearable inventory item not found" << wearable->getName() +				<< " itemID " << wearable->getItemID().asString() << llendl; +	} +} +  void LLAgentWearables::dump()  {  	llinfos << "LLAgentWearablesDump" << llendl; @@ -657,6 +690,7 @@ LLWearable* LLAgentWearables::getWearable(const EWearableType type, U32 index)  void LLAgentWearables::setWearable(const EWearableType type, U32 index, LLWearable *wearable)  { +  	LLWearable *old_wearable = getWearable(type,index);  	if (!old_wearable)  	{ @@ -680,6 +714,7 @@ void LLAgentWearables::setWearable(const EWearableType type, U32 index, LLWearab  		wearable_vec[index] = wearable;  		old_wearable->setLabelUpdated();  		wearableUpdated(wearable); +		checkWearableAgainstInventory(wearable);  	}  } @@ -695,6 +730,7 @@ U32 LLAgentWearables::pushWearable(const EWearableType type, LLWearable *wearabl  	{  		mWearableDatas[type].push_back(wearable);  		wearableUpdated(wearable); +		checkWearableAgainstInventory(wearable);  		return mWearableDatas[type].size()-1;  	}  	return MAX_WEARABLES_PER_TYPE; @@ -1705,6 +1741,7 @@ void LLAgentWearables::setWearableFinal(LLInventoryItem* new_item, LLWearable* n  		mWearableDatas[type].push_back(new_wearable);  		llinfos << "Added additional wearable for type " << type  				<< " size is now " << mWearableDatas[type].size() << llendl; +		checkWearableAgainstInventory(new_wearable);  	}  	else  	{ | 
