mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-27 17:43:53 +01:00
Bugfix //walls: correct nodes_needed calculations to take thickness into account
This commit is contained in:
parent
f30ddbae3b
commit
f5f486f303
@ -29,11 +29,14 @@ worldedit.register_command("walls", {
|
|||||||
|
|
||||||
return true, target_node, math.floor(thickness)
|
return true, target_node, math.floor(thickness)
|
||||||
end,
|
end,
|
||||||
nodes_needed = function(name)
|
nodes_needed = function(name, target_node, thickness)
|
||||||
-- //overlay only modifies up to 1 node per column in the selected region
|
-- //overlay only modifies up to 1 node per column in the selected region
|
||||||
local pos1, pos2 = worldedit.sort_pos(worldedit.pos1[name], worldedit.pos2[name])
|
local pos1, pos2 = worldedit.sort_pos(worldedit.pos1[name], worldedit.pos2[name])
|
||||||
|
|
||||||
local pos3 = { x = pos2.x - 2, z = pos2.z - 2, y = pos2.y }
|
local pos3 = {
|
||||||
|
x = pos2.x - thickness*2,
|
||||||
|
z = pos2.z - thickness*2,
|
||||||
|
y = pos2.y }
|
||||||
|
|
||||||
return worldedit.volume(pos1, pos2) - worldedit.volume(pos1, pos3)
|
return worldedit.volume(pos1, pos2) - worldedit.volume(pos1, pos3)
|
||||||
end,
|
end,
|
||||||
|
Loading…
Reference in New Issue
Block a user