mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-22 15:33:00 +00:00
//revolve: don't rotate air nodes
this is important because when rotating multiple times it can easily overwrite parts of the structure with pointless air nodes where it shouldn't do
This commit is contained in:
parent
e942e4fb2f
commit
cf8406b80f
1 changed files with 20 additions and 16 deletions
|
@ -46,8 +46,12 @@ function worldeditadditions.revolve(pos1, pos2, origin, times)
|
|||
for z = pos2_source.z, pos1_source.z, -1 do
|
||||
for y = pos2_source.y, pos1_source.y, -1 do
|
||||
for x = pos2_source.x, pos1_source.x, -1 do
|
||||
for index, rotation in ipairs(rotation_radians) do
|
||||
local pos_source = Vector3.new(x, y, z)
|
||||
local i_source = area_source:index(x, y, z)
|
||||
|
||||
-- Lua really sucks sometimes... a continue statement would be v useful here
|
||||
if not wea_c.is_airlike(data_source[i_source]) then
|
||||
for index, rotation in ipairs(rotation_radians) do
|
||||
local pos_target = Vector3.rotate3d(
|
||||
origin,
|
||||
pos_source,
|
||||
|
@ -56,7 +60,6 @@ function worldeditadditions.revolve(pos1, pos2, origin, times)
|
|||
Vector3.new(0, rotation * math.pi * 2, 0)
|
||||
):floor()
|
||||
|
||||
local i_source = area_source:index(x, y, z)
|
||||
local i_target = area_target:index(pos_target.x, pos_target.y, pos_target.z)
|
||||
|
||||
-- TODO: Rotate notes as appropriate
|
||||
|
@ -66,6 +69,7 @@ function worldeditadditions.revolve(pos1, pos2, origin, times)
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Save the modified nodes back to disk & return
|
||||
worldedit.manip_helpers.finish(manip_target, data_target)
|
||||
|
|
Loading…
Reference in a new issue