diff --git a/extensions/scripting/lua-bindings/manual/CCLuaStack.cpp b/extensions/scripting/lua-bindings/manual/CCLuaStack.cpp index 2e97cf769f..00dd78b973 100644 --- a/extensions/scripting/lua-bindings/manual/CCLuaStack.cpp +++ b/extensions/scripting/lua-bindings/manual/CCLuaStack.cpp @@ -94,6 +94,11 @@ namespace { return 0; } + + int lua_version(lua_State* L) { + lua_pushinteger(L, LUA_VERSION_NUM); + return 1; + } } NS_CC_BEGIN @@ -132,6 +137,7 @@ bool LuaStack::init() const luaL_Reg global_functions [] = { {"print", lua_print}, {"release_print",lua_release_print}, + {"version", lua_version}, {nullptr, nullptr} }; luaL_register(_state, "_G", global_functions);