summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2013-12-04 21:46:32 -0700
committerXiaohong Bao <bao@lindenlab.com>2013-12-04 21:46:32 -0700
commit526be23096671e8916ec2b5644a46020f33479a8 (patch)
tree1dfe20a413e5c9743fad71f2d8dd53bcab044b85 /indra
parent7e17824f61a0ee160d2c28e24bdd87a005b4c17d (diff)
fix for SH-4627: "Object out of range" is not detected on teleport.
Diffstat (limited to 'indra')
-rwxr-xr-xindra/newview/lldrawable.cpp14
-rwxr-xr-xindra/newview/lldrawable.h1
-rwxr-xr-xindra/newview/llpreviewscript.cpp2
-rwxr-xr-xindra/newview/llviewerobject.cpp5
-rwxr-xr-xindra/newview/llviewerobject.h2
5 files changed, 23 insertions, 1 deletions
diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp
index 7414b24811..5c42868127 100755
--- a/indra/newview/lldrawable.cpp
+++ b/indra/newview/lldrawable.cpp
@@ -968,6 +968,20 @@ void LLDrawable::shiftPos(const LLVector4a &shift_vector)
mVObjp->onShift(shift_vector);
}
+bool LLDrawable::hasVertexBuffer() const
+{
+ for (S32 i = 0; i < getNumFaces(); i++)
+ {
+ LLFace *facep = getFace(i);
+ if (facep && facep->getVertexBuffer() != NULL)
+ {
+ return true;
+ }
+ }
+
+ return false;
+}
+
const LLVector3& LLDrawable::getBounds(LLVector3& min, LLVector3& max) const
{
mXform.getMinMax(min,max);
diff --git a/indra/newview/lldrawable.h b/indra/newview/lldrawable.h
index a3461d4c01..4648e6272e 100755
--- a/indra/newview/lldrawable.h
+++ b/indra/newview/lldrawable.h
@@ -173,6 +173,7 @@ public:
bool isVisible() const;
bool isRecentlyVisible() const;
+ bool hasVertexBuffer() const;
virtual void cleanupReferences();
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index 870304a7b8..61a34d0581 100755
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -2101,7 +2101,7 @@ LLLiveLSLSaveData::LLLiveLSLSaveData(const LLUUID& id,
void LLLiveLSLEditor::saveIfNeeded(bool sync /*= true*/)
{
LLViewerObject* object = gObjectList.findObject(mObjectUUID);
- if(!object)
+ if(!object || !object->hasVertexBuffer())
{
LLNotificationsUtil::add("SaveScriptFailObjectNotFound");
return;
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index 9e2999e521..df5ce65486 100755
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -444,6 +444,11 @@ void LLViewerObject::markDead()
}
}
+bool LLViewerObject::hasVertexBuffer() const
+{
+ return mDrawable.notNull() && mDrawable->hasVertexBuffer();
+}
+
void LLViewerObject::dump() const
{
LL_INFOS() << "Type: " << pCodeToString(mPrimitiveCode) << LL_ENDL;
diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h
index a2008215d2..31b2bd6b99 100755
--- a/indra/newview/llviewerobject.h
+++ b/indra/newview/llviewerobject.h
@@ -188,6 +188,8 @@ public:
virtual U32 getNumIndices() const;
S32 getNumFaces() const { return mNumFaces; }
+ bool hasVertexBuffer() const;
+
// Graphical stuff for objects - maybe broken out into render class later?
virtual void updateTextures();
virtual void boostTexturePriority(BOOL boost_children = TRUE); // When you just want to boost priority of this object