Bugfix //walls: correct nodes_needed calculations to take thickness into account

This commit is contained in:
Starbeamrainbowlabs 2021-08-05 02:07:20 +01:00
parent f30ddbae3b
commit f5f486f303
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -29,11 +29,14 @@ worldedit.register_command("walls", {
return true, target_node, math.floor(thickness)
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
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)
end,