diff --git a/Source/utils/lua.cpp b/Source/utils/lua.cpp index 66e6a8e9c95..f595af64d8b 100644 --- a/Source/utils/lua.cpp +++ b/Source/utils/lua.cpp @@ -108,13 +108,14 @@ void LuaInitialize() #endif // Registering globals - lua["print"] = LuaPrint; - lua["_VERSION"] = LUA_VERSION; + lua.set( + "print", LuaPrint, + "_VERSION", LUA_VERSION); // Registering devilutionx object table - sol::table devilutionx(lua, sol::create); - devilutionx["message"] = LuaPlayerMessage; - lua["devilutionx"] = devilutionx; + lua.create_named_table( + "devilutionx", + "message", LuaPlayerMessage); RunScript("lua/init.lua"); RunScript("lua/user.lua");