fixed #1641: The coins in Watermelon Me fail to animate in cocos2d-x JS binding.

This commit is contained in:
James Chen 2013-01-05 18:54:08 +08:00
parent 8a21f4fa3c
commit 266e6e8acc
1 changed files with 2 additions and 2 deletions

View File

@ -153,7 +153,7 @@ void CCAnimationCache::parseVersion2(CCDictionary* animations)
const char* name = pElement->getStrKey();
CCDictionary* animationDict = (CCDictionary*)pElement->getObject();
int loops = animationDict->valueForKey("loops")->intValue();
const CCString* loops = animationDict->valueForKey("loops");
bool restoreOriginalFrame = animationDict->valueForKey("restoreOriginalFrame")->boolValue();
CCArray* frameArray = (CCArray*)animationDict->objectForKey("frames");
@ -193,7 +193,7 @@ void CCAnimationCache::parseVersion2(CCDictionary* animations)
float delayPerUnit = animationDict->valueForKey("delayPerUnit")->floatValue();
CCAnimation *animation = new CCAnimation();
animation->initWithAnimationFrames(array, delayPerUnit, loops);
animation->initWithAnimationFrames(array, delayPerUnit, 0 != loops->length() ? loops->intValue() : 1);
array->release();
animation->setRestoreOriginalFrame(restoreOriginalFrame);