Fix 1.6 version bone animation crash when perform getBoneAtPoint(0,0)

This commit is contained in:
XiaoFeng 2015-09-14 17:36:19 +08:00
parent 1fd2e65b48
commit 12f0f7f580
1 changed files with 5 additions and 3 deletions

View File

@ -383,10 +383,12 @@ bool DisplayManager::containPoint(Vec2 &point)
Vec2 outPoint;
Sprite *sprite = (Sprite *)_currentDecoDisplay->getDisplay();
sprite = (Sprite *)sprite->getChildByTag(0);
ret = CC_SPRITE_CONTAIN_POINT_WITH_RETURN(sprite, point, outPoint);
Sprite *child = (Sprite *)sprite->getChildByTag(0);
if(nullptr != child)
sprite = child;
if (nullptr != sprite)
ret = CC_SPRITE_CONTAIN_POINT_WITH_RETURN(sprite, point, outPoint);
}
break;