Sfoglia il codice sorgente

Merge branch 'next' of https://github.com/blackberry-gaming/GamePlay into next-dgough

Darryl Gough 14 anni fa
parent
commit
6c044256bd
1 ha cambiato i file con 9 aggiunte e 6 eliminazioni
  1. 9 6
      gameplay/src/Animation.cpp

+ 9 - 6
gameplay/src/Animation.cpp

@@ -331,14 +331,17 @@ void Animation::addClip(AnimationClip* clip)
 
 AnimationClip* Animation::findClip(const char* id) const
 {
-    AnimationClip* clip = NULL;
-    unsigned int clipCount = _clips->size();
-    for (unsigned int i = 0; i < clipCount; i++)
+    if (_clips)
     {
-        clip = _clips->at(i);
-        if (clip->_id.compare(id) == 0)
+        AnimationClip* clip = NULL;
+        unsigned int clipCount = _clips->size();
+        for (unsigned int i = 0; i < clipCount; i++)
         {
-            return _clips->at(i);
+            clip = _clips->at(i);
+            if (clip->_id.compare(id) == 0)
+            {
+                return _clips->at(i);
+            }
         }
     }
     return NULL;