From 0d7c4538786e24ba33d8ce4b8adef77fdf91a1e8 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Mon, 23 Jun 2014 16:38:35 +0800 Subject: [PATCH] Fix the error that lua binding for create function of Sequence would lead to endless loop --- .../scripting/lua-bindings/manual/lua_cocos2dx_manual.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cocos/scripting/lua-bindings/manual/lua_cocos2dx_manual.cpp b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_manual.cpp index b18f9a583e..6c4076f154 100644 --- a/cocos/scripting/lua-bindings/manual/lua_cocos2dx_manual.cpp +++ b/cocos/scripting/lua-bindings/manual/lua_cocos2dx_manual.cpp @@ -1756,19 +1756,19 @@ int tolua_cocos2d_Sequence_create(lua_State* tolua_S) goto tolua_lerror; #endif - cocos2d::FiniteTimeAction* item = static_cast(tolua_tousertype(tolua_S, 1 + i, NULL)); - if (NULL != item) + cocos2d::FiniteTimeAction* item = static_cast(tolua_tousertype(tolua_S, 1 + i, nullptr)); + if (nullptr != item) { array.pushBack(item); - ++i; } + ++i; } } cocos2d::Sequence* tolua_ret = cocos2d::Sequence::create(array); //issue 2433 uncheck int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1; - int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL; + int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : nullptr; toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"cc.Sequence"); return 1; }