diff --git a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.cpp b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.cpp index da15b71819..e8da5290ee 100644 --- a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.cpp +++ b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.cpp @@ -1995,23 +1995,23 @@ void vec3_to_luaval(lua_State* L,const cocos2d::Vec3& vec3) lua_rawset(L, -3); } -void vec4_to_luaval(lua_State* L,const cocos2d::Vec4& vec3) +void vec4_to_luaval(lua_State* L,const cocos2d::Vec4& vec4) { if (NULL == L) return; lua_newtable(L); /* L: table */ lua_pushstring(L, "x"); /* L: table key */ - lua_pushnumber(L, (lua_Number) vec3.x); /* L: table key value*/ + lua_pushnumber(L, (lua_Number) vec4.x); /* L: table key value*/ lua_rawset(L, -3); /* table[key] = value, L: table */ lua_pushstring(L, "y"); /* L: table key */ - lua_pushnumber(L, (lua_Number) vec3.y); /* L: table key value*/ + lua_pushnumber(L, (lua_Number) vec4.y); /* L: table key value*/ lua_rawset(L, -3); lua_pushstring(L, "z"); /* L: table key */ - lua_pushnumber(L, (lua_Number) vec3.z); /* L: table key value*/ + lua_pushnumber(L, (lua_Number) vec4.z); /* L: table key value*/ lua_rawset(L, -3); lua_pushstring(L, "w"); /* L: table key */ - lua_pushnumber(L, (lua_Number) vec3.z); /* L: table key value*/ + lua_pushnumber(L, (lua_Number) vec4.w); /* L: table key value*/ lua_rawset(L, -3); } diff --git a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h index 2d07f4a2f2..6626ecad1c 100644 --- a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h +++ b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h @@ -240,7 +240,7 @@ extern bool luaval_to_std_vector_ushort(lua_State* L, int lo, std::vectorsetScriptEngine(engine); lua_State* L = engine->getLuaStack()->getLuaState(); - lua_getglobal(L, "_G"); - if (lua_istable(L,-1))//stack:...,_G, - { - lua_module_register(L); - } - lua_pop(L, 1);//statck:... + lua_module_register(L); LuaStack* stack = engine->getLuaStack(); stack->setXXTEAKeyAndSign("2dxLua", strlen("2dxLua"), "XXTEA", strlen("XXTEA"));