From 40987f16b60116626149482c895c2bf60adc0a3c Mon Sep 17 00:00:00 2001 From: MihailRis Date: Sat, 13 Jan 2024 11:16:44 +0300 Subject: [PATCH] small lua fix --- src/logic/scripting/api_lua.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/logic/scripting/api_lua.cpp b/src/logic/scripting/api_lua.cpp index f75e3216..c48e4000 100644 --- a/src/logic/scripting/api_lua.cpp +++ b/src/logic/scripting/api_lua.cpp @@ -14,6 +14,14 @@ #include "../../lighting/Lighting.h" #include "../../logic/BlocksController.h" +#if (LUA_VERSION_NUM < 503 and not defined(LUAJIT_VERSION)) +static void luaL_openlib(lua_State* L, const char* name, const luaL_Reg* libfuncs) { + lua_newtable(L); + luaL_setfuncs(L, libfuncs, 0); + lua_setglobal(L, name); +} +#endif + /* == world library ==*/ static int l_world_get_day_time(lua_State* L) { lua_pushnumber(L, scripting::level->world->daytime);