[BUG] Actions within a Sequence don't update elapsed time?

I have written a custom action, and I update its state/progress not based on the value passed in to its update method (which is a completion ratio, from 0.0 - 1.0), but instead based on the total elapsed time since the action started running (I get it from the getElapsed() method). It just makes the code for this particular custom action a little simpler.

When I run my custom action within a Sequence action, the elapsed time never updates, it’s always 0. I’ve dug around cocos2d codebase (specifically ActionInterval.cpp) and it looks like this behavior is deliberate and expected, because the Sequence action never calls the step method (or otherwise updates the elapsed time) for any action in the sequence.

So my question is, is this really how actions in a Sequence are supposed to behave? It doesn’t make any sense to me why an action should behave one way when run by itself, and then a different way when run outside of a sequence.

It appears there is a similar issue when actions are eased.

So you just need to do something after some elapsed time? Why not use something like this.

// Create a delayed action sequence that fires a callback
auto callback = CallFunc::create(CC_CALLBACK_0(SomeLayer::someCallbackFunc, this));
this->runAction(CCSequence::create(CCDelayTime::create(1.0f), callback, NULL));


..
void SomeLayer::someCallbackFunc()
{
    // do stuff
}

That’s not what I’m trying to do, I want to update the state of my action based on the amount of time that has passed since the action started.

For example, if my action lasts 2 seconds long, my update method might do something like:

At 16 milliseconds update state of action’s target
At 64 milliseconds update state of action’s target
At 256 milliseconds update state of action’s target

At 2 seconds update state of action’s target for the final time

Ultimately it’s not a big deal, I modified my action to use the ratio value passed in to the action’s update method. The problem I’m outlining is that when the action is run outside of a sequence, I can get the elapsed time I described above (16ms, 64ms, 256ms, etc…) from the getElapsed() method. When run inside of a sequence, getElapsed will always return 0, no matter how much time has elapsed since I kicked off the action. That makes no sense.