summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerobject.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2012-06-22 14:04:33 -0500
committerDave Parks <davep@lindenlab.com>2012-06-22 14:04:33 -0500
commit9e9d32de384b2807f195be48f49fbdec725f45d1 (patch)
tree802158bd1a8872500ffeee286256f4c3ff79ef72 /indra/newview/llviewerobject.cpp
parent3c276c87bde4ff9403df93434e8dc5309a3441b9 (diff)
parentdefbd61d318d0da12fdea208cf2b2297d9a6b122 (diff)
merge
Diffstat (limited to 'indra/newview/llviewerobject.cpp')
-rw-r--r--indra/newview/llviewerobject.cpp50
1 files changed, 46 insertions, 4 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index da72f2fdac..72fd3c1a4a 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -432,7 +432,9 @@ void LLViewerObject::dump() const
llinfos << "PositionAgent: " << getPositionAgent() << llendl;
llinfos << "PositionGlobal: " << getPositionGlobal() << llendl;
llinfos << "Velocity: " << getVelocity() << llendl;
- if (mDrawable.notNull() && mDrawable->getNumFaces())
+ if (mDrawable.notNull() &&
+ mDrawable->getNumFaces() &&
+ mDrawable->getFace(0))
{
LLFacePool *poolp = mDrawable->getFace(0)->getPool();
if (poolp)
@@ -2799,6 +2801,23 @@ void LLViewerObject::processTaskInvFile(void** user_data, S32 error_code, LLExtS
(object = gObjectList.findObject(ft->mTaskID)))
{
object->loadTaskInvFile(ft->mFilename);
+
+ LLInventoryObject::object_list_t::iterator it = object->mInventory->begin();
+ LLInventoryObject::object_list_t::iterator end = object->mInventory->end();
+ std::list<LLUUID>& pending_lst = object->mPendingInventoryItemsIDs;
+
+ for (; it != end && pending_lst.size(); ++it)
+ {
+ LLViewerInventoryItem* item = dynamic_cast<LLViewerInventoryItem*>(it->get());
+ if(item && item->getType() != LLAssetType::AT_CATEGORY)
+ {
+ std::list<LLUUID>::iterator id_it = std::find(pending_lst.begin(), pending_lst.begin(), item->getAssetUUID());
+ if (id_it != pending_lst.end())
+ {
+ pending_lst.erase(id_it);
+ }
+ }
+ }
}
else
{
@@ -2911,7 +2930,22 @@ void LLViewerObject::updateInventory(
bool is_new)
{
LLMemType mt(LLMemType::MTYPE_OBJECT);
-
+
+ std::list<LLUUID>::iterator begin = mPendingInventoryItemsIDs.begin();
+ std::list<LLUUID>::iterator end = mPendingInventoryItemsIDs.end();
+
+ bool is_fetching = std::find(begin, end, item->getAssetUUID()) != end;
+ bool is_fetched = getInventoryItemByAsset(item->getAssetUUID()) != NULL;
+
+ if (is_fetched || is_fetching)
+ {
+ return;
+ }
+ else
+ {
+ mPendingInventoryItemsIDs.push_back(item->getAssetUUID());
+ }
+
// This slices the object into what we're concerned about on the
// viewer. The simulator will take the permissions and transfer
// ownership.
@@ -4478,7 +4512,11 @@ U32 LLViewerObject::getNumVertices() const
num_faces = mDrawable->getNumFaces();
for (i = 0; i < num_faces; i++)
{
- num_vertices += mDrawable->getFace(i)->getGeomCount();
+ LLFace * facep = mDrawable->getFace(i);
+ if (facep)
+ {
+ num_vertices += facep->getGeomCount();
+ }
}
}
return num_vertices;
@@ -4493,7 +4531,11 @@ U32 LLViewerObject::getNumIndices() const
num_faces = mDrawable->getNumFaces();
for (i = 0; i < num_faces; i++)
{
- num_indices += mDrawable->getFace(i)->getIndicesCount();
+ LLFace * facep = mDrawable->getFace(i);
+ if (facep)
+ {
+ num_indices += facep->getIndicesCount();
+ }
}
}
return num_indices;