CCRepeatForever CCRepeat bug

CCRepeat and CCRepeatForever can not create by another antions like this:

local pAction = CCRepeatForever:create( CCSequence:create(some_actions) )

LuaCocos2d.cpp should change:

if (
!tolua_isusertable(tolua_S,1,“CCRepeatForever”,0,&tolua_err) ||
!tolua_isusertype(tolua_S,2,“CCActionInterval”,0,&tolua_err)
!tolua_isnoobj(tolua_S,3,&tolua_err)
)

TO:

if (
!tolua_isusertable(tolua_S,1,“CCRepeatForever”,0,&tolua_err) ||
!(tolua_isusertype(tolua_S,2,“CCActionInterval”,0,&tolua_err) || tolua_isusertype(tolua_S,2,“CCFiniteTimeAction”,0,&tolua_err)) ||
!tolua_isnoobj(tolua_S,3,&tolua_err)
)

Note
code
CCRepeatForever:create(tolua.cast(CCSequence:create(some_actions), ‘CCActionInterval’) ))

instead of
CCSequence:create(some_actions) returns a CCFiniteTimeAction

CCFiniteTimeAction is derived CCActionInterval so the cast cannot be inferred by tolua.

You should search the forums and will find many more comments.

Good luck.

Andre

:smiley: thanks, It works!