Vector<FiniteTimeAction*> list;
for(int index : this->myDataList){
list.pushBack(something);
}
runAction(Sequence::create(list));
I found if nothing added to list, it will crash, why cocos2d not ignore running empty action?
Vector<FiniteTimeAction*> list;
for(int index : this->myDataList){
list.pushBack(something);
}
runAction(Sequence::create(list));
I found if nothing added to list, it will crash, why cocos2d not ignore running empty action?
Sequence::create(emptyVector); returns nullptr and runAction eventually runs this code action->startWithTarget and so the engine developers decided to not allow null actions.
I’m not sure if the engine developers should consider refactoring some classes to use the null object pattern.