mirror of https://github.com/axmolengine/axmol.git
Merge pull request #11872 from xiaofeng11/v3
Fix ArmatureAnimation crash
This commit is contained in:
commit
c2f245733c
|
@ -166,10 +166,20 @@ float ArmatureAnimation::getSpeedScale() const
|
||||||
|
|
||||||
void ArmatureAnimation::play(const std::string& animationName, int durationTo, int loop)
|
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());
|
_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
|
//! Get key frame count
|
||||||
_rawDuration = _movementData->duration;
|
_rawDuration = _movementData->duration;
|
||||||
|
|
Loading…
Reference in New Issue