diff --git a/worldeditadditions/lib/move.lua b/worldeditadditions/lib/move.lua index 63586f1..076287f 100644 --- a/worldeditadditions/lib/move.lua +++ b/worldeditadditions/lib/move.lua @@ -28,7 +28,6 @@ function worldeditadditions.move(source_pos1, source_pos2, target_pos1, target_p local data_target = manip_target:get_data() -- z y x is the preferred loop order (because CPU cache, since then we're iterating linearly through the data array backwards. This only holds true for little-endian machines however) - for z = source_pos2.z, source_pos1.z, -1 do for y = source_pos2.y, source_pos1.y, -1 do for x = source_pos2.x, source_pos1.x, -1 do @@ -37,14 +36,19 @@ function worldeditadditions.move(source_pos1, source_pos2, target_pos1, target_p local target = source:subtract(offset) local target_i = area_target:index(target.x, target.y, target.z) + data_target[target_i] = data_source[source_i] data_source[source_i] = node_id_air + end end end -- Save the modified nodes back to disk & return -- Note that we save the source region *first* to avoid issues with overlap + + -- BUG: Voxel Manipulators cover a larger area than the source area if the target position is too close the to the source, then the source will be overwritten by the target by accident. + worldedit.manip_helpers.finish(manip_source, data_source) worldedit.manip_helpers.finish(manip_target, data_target)