Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer

This commit is contained in:
Latif Khalifa
2013-08-27 14:47:50 +02:00
9 changed files with 92 additions and 2 deletions

View File

@@ -1163,11 +1163,41 @@ void LLWearableHoldingPattern::onWearableAssetFetch(LLViewerWearable *wearable)
if(wearable->getAssetID() == data.mAssetID)
{
// Failing this means inventory or asset server are corrupted in a way we don't handle.
if ((data.mWearableType >= LLWearableType::WT_COUNT) || (wearable->getType() != data.mWearableType))
if (data.mWearableType >= LLWearableType::WT_COUNT ||
wearable->getType() >= LLWearableType::WT_UNKNOWN ||
(data.mWearableType != wearable->getType() &&
data.mWearableType != LLWearableType::WT_UNKNOWN &&
data.mWearableType != LLWearableType::WT_SHAPE))
{
llwarns << self_av_string() << "recovered wearable but type invalid. inventory wearable type: " << data.mWearableType << " asset wearable type: " << wearable->getType() << llendl;
break;
}
else if (data.mWearableType == LLWearableType::WT_UNKNOWN ||
(data.mWearableType == LLWearableType::WT_SHAPE &&
data.mWearableType != wearable->getType()))
{
if (data.mWearableType == LLWearableType::WT_UNKNOWN)
{
llinfos << "Wearing wearable '" << wearable->getName() << "' with an unknown inventory wearable type. Fixing inventory to have type " << wearable->getType() << llendl;
}
else
{
// This probably means that the inventory contains an item without wearable type information.
// We can still fix the type here, but we also have to fix that in the mean time we took off our real shape because of this!
llwarns << "Wearing wearable '" << wearable->getName() << "' with incorrect wearable type 'shape'! Trying to recover from this..." << llendl;
}
// Fix it!
data.mWearableType = wearable->getType();
LLViewerInventoryItem* item = gInventory.getItem(data.mItemID);
if (!item)
{
llwarns << "Can't find the broken item in the inventory?!" << llendl;
break;
}
llassert(item->getUUID() == data.mItemID);
item->setWearableType(wearable->getType());
gInventory.updateItem(item);
}
data.mWearable = wearable;
}

View File

@@ -88,6 +88,7 @@ LLIconDictionary::LLIconDictionary()
addEntry(LLInventoryType::ICONNAME_LINKFOLDER, new IconEntry("inv_link_folder.tga"));
addEntry(LLInventoryType::ICONNAME_MESH, new IconEntry("inv_item_mesh.tga"));
addEntry(LLInventoryType::ICONNAME_CLOTHING_UNKNOWN, new IconEntry("inv_item_unknown.tga"));
addEntry(LLInventoryType::ICONNAME_INVALID, new IconEntry("inv_invalid.png"));
addEntry(LLInventoryType::ICONNAME_NONE, new IconEntry("NONE"));

View File

@@ -311,6 +311,12 @@ void LLViewerInventoryItem::removeFromServer()
void LLViewerInventoryItem::updateServer(BOOL is_new) const
{
if(getWearableType() == LLWearableType::WT_UNKNOWN)
{
llwarns << "LLViewerInventoryItem::updateServer() - for item with unknown wearable type"
<< llendl;
return;
}
if(!mIsComplete)
{
// *FIX: deal with this better.
@@ -1777,6 +1783,15 @@ LLWearableType::EType LLViewerInventoryItem::getWearableType() const
return LLWearableType::EType(getFlags() & LLInventoryItemFlags::II_FLAGS_WEARABLES_MASK);
}
void LLViewerInventoryItem::setWearableType(LLWearableType::EType type)
{
if (getWearableType() != LLWearableType::WT_UNKNOWN)
{
llwarns << "Calling LLViewerInventoryItem::setWearableType for item that does not have an unknown wearable type!?" << llendl;
return;
}
mFlags = (mFlags & ~LLInventoryItemFlags::II_FLAGS_WEARABLES_MASK) | type;
}
time_t LLViewerInventoryItem::getCreationDate() const
{

View File

@@ -162,6 +162,11 @@ public:
// If this is a broken link, try to fix it and any other identical link.
BOOL regenerateLink();
//<singu>
// Change WT_UNKNOWN to the type retrieved from the asset.
void setWearableType(LLWearableType::EType type);
//</singu>
public:
BOOL mIsComplete;
LLTransactionID mTransactionID;

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB