forked from mtcontrib/Minetest-WorldEdit
Make //fixlight work again
The dig-air-nodes method seems to have stopped working a few Minetest version ago
This commit is contained in:
parent
3a7fb5bf1e
commit
92fe95fab7
|
@ -575,14 +575,11 @@ end
|
||||||
function worldedit.fixlight(pos1, pos2)
|
function worldedit.fixlight(pos1, pos2)
|
||||||
local pos1, pos2 = worldedit.sort_pos(pos1, pos2)
|
local pos1, pos2 = worldedit.sort_pos(pos1, pos2)
|
||||||
|
|
||||||
worldedit.keep_loaded(pos1, pos2)
|
local vmanip = minetest.get_voxel_manip(pos1, pos2)
|
||||||
|
vmanip:write_to_map()
|
||||||
|
vmanip:update_map() -- this updates the lighting
|
||||||
|
|
||||||
local nodes = minetest.find_nodes_in_area(pos1, pos2, "air")
|
return worldedit.volume(pos1, pos2)
|
||||||
local dig_node = minetest.dig_node
|
|
||||||
for _, pos in ipairs(nodes) do
|
|
||||||
dig_node(pos)
|
|
||||||
end
|
|
||||||
return #nodes
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user