Fix ArmatureAnimation crash

This commit is contained in:
XiaoFeng 2015-05-18 12:08:26 +08:00
parent 56070da720
commit be20666b65
1 changed files with 12 additions and 2 deletions

View File

@ -166,10 +166,20 @@ float ArmatureAnimation::getSpeedScale() const
void ArmatureAnimation::play(const std::string& animationName, int durationTo, int loop)
{
CCASSERT(_animationData, "_animationData can not be null");
if (animationName.empty())
{
CCLOG("_animationData can not be null");
return;
}
// CCASSERT(_animationData, "_animationData can not be null");
_movementData = _animationData->getMovement(animationName.c_str());
CCASSERT(_movementData, "_movementData can not be null");
if (nullptr == _movementData)
{
CCLOG("_movementData can not be null");
return;
}
// CCASSERT(_movementData, "_movementData can not be null");
//! Get key frame count
_rawDuration = _movementData->duration;