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)
|
||||
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,
|
||||
|
Loading…
Reference in New Issue
Block a user