From bf154b12c7099fb2a7ca0810a0ca729e65df950b Mon Sep 17 00:00:00 2001 From: sfan5 Date: Fri, 30 May 2025 15:39:06 +0200 Subject: [PATCH] Use new 5.13.0 explicit VoxelManip free --- .github/workflows/test.yml | 2 +- worldedit/common.lua | 4 +++- worldedit/manipulations.lua | 9 +++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d1e181c..b8f3d66 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: - { image: 'registry.gitlab.com/minetest/minetest/server:5.0.1', mtg: false } - { image: 'registry.gitlab.com/minetest/minetest/server:5.5.1', mtg: false } - { image: 'ghcr.io/minetest/minetest:5.10.0', mtg: true } - - { image: 'ghcr.io/luanti-org/luanti', mtg: true } # latest git + - { image: 'ghcr.io/luanti-org/luanti:master', mtg: true } # latest git steps: - uses: actions/checkout@v4 diff --git a/worldedit/common.lua b/worldedit/common.lua index 8289f66..b01b694 100644 --- a/worldedit/common.lua +++ b/worldedit/common.lua @@ -133,7 +133,9 @@ function mh.finish(manip, data) manip:set_data(data) end manip:write_to_map() - manip:update_map() + if manip.close ~= nil then + manip:close() -- explicitly free memory + end end diff --git a/worldedit/manipulations.lua b/worldedit/manipulations.lua index 73d0242..d682b59 100644 --- a/worldedit/manipulations.lua +++ b/worldedit/manipulations.lua @@ -56,8 +56,7 @@ function worldedit.set_param2(pos1, pos2, param2) -- Update map manip:set_param2_data(param2_data) - manip:write_to_map() - manip:update_map() + mh.finish(manip) return worldedit.volume(pos1, pos2) end @@ -269,8 +268,10 @@ function worldedit.fixlight(pos1, pos2) local pos1, pos2 = worldedit.sort_pos(pos1, pos2) local vmanip = minetest.get_voxel_manip(pos1, pos2) - vmanip:write_to_map() - vmanip:update_map() -- this updates the lighting + vmanip:write_to_map() -- this updates the lighting + if vmanip.close ~= nil then + vmanip:close() + end return worldedit.volume(pos1, pos2) end