summaryrefslogtreecommitdiff
path: root/common/object.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/object.cpp')
-rwxr-xr-xcommon/object.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/common/object.cpp b/common/object.cpp
index 1b8a91c..88e1f6c 100755
--- a/common/object.cpp
+++ b/common/object.cpp
@@ -250,7 +250,10 @@ void Object::CalculateKeys (unsigned short nTime, bool bAnimation)
int i, empty = m_nKeyInfoCount;
for (i = 0; i < m_nKeyInfoCount; i++)
+ {
next[i] = NULL;
+ prev[i] = NULL;
+ }
if (bAnimation)
node = m_pAnimationKeys;
@@ -281,6 +284,8 @@ void Object::CalculateKeys (unsigned short nTime, bool bAnimation)
{
LC_OBJECT_KEY *n = next[i], *p = prev[i];
+ if (p == NULL) continue;
+
if (bAnimation && (n != NULL) && (p->time != nTime))
{
float t = (float)(nTime - p->time)/(n->time - p->time);