I have a game with cocos2d-x-3.15.1 where I have an item which I am moving. I want to get a callback called when the action is done. For this I have used following code structure.
ActionEase* const action = MoveTo::create(timeToStop, destinationPoint);
TargetedAction* const targetedAction = TargetedAction::create(item, action);
CallFunc* const dispatchEvent = CallFunc::create([this]()
{
_eventDispatcher->dispatchCustomEvent(EVENT);
});
auto itemsMoveAction = Sequence::createWithTwoActions(targetedAction, dispatchEvent);
runAction(itemsMoveAction);
But my code, sometimes fails to execute correct and I suspect that is becouse of this https://github.com/cocos2d/cocos2d-x/issues/18046 Sequence fails to complete. #18046 bug. How can I achieve the same functionality without using Sequence?