diff --git a/extensions/scripting/lua-bindings/manual/Cocos2dxLuaLoader.cpp b/extensions/scripting/lua-bindings/manual/Cocos2dxLuaLoader.cpp index e0c9910a29..2a7db54e2a 100644 --- a/extensions/scripting/lua-bindings/manual/Cocos2dxLuaLoader.cpp +++ b/extensions/scripting/lua-bindings/manual/Cocos2dxLuaLoader.cpp @@ -108,15 +108,13 @@ extern "C" { LuaStack* stack = LuaEngine::getInstance()->getLuaStack(); resolvedPath.insert(resolvedPath.begin(), '@'); // lua standard, add file chunck mark '@' - stack->luaLoadBuffer(L, reinterpret_cast(chunk.getBytes()), static_cast(chunk.getSize()), + return stack->luaLoadBuffer(L, reinterpret_cast(chunk.getBytes()), static_cast(chunk.getSize()), resolvedPath.c_str()); } else { CCLOG("can not get file data of %s", resolvedPath.c_str()); - return 0; + return LUA_ERRFILE; } - - return 1; } }