diff options
author | Kyle <kyle.kylina@gmail.com> | 2012-08-26 13:14:47 -0700 |
---|---|---|
committer | Kyle <kyle.kylina@gmail.com> | 2012-08-26 13:14:47 -0700 |
commit | 91c24d3a609bc1e22f132f6c8a9e9b86f0850fa5 (patch) | |
tree | 5a5742031bf91f0737dfd4bf36b4e4a43ab0cb79 /functions.lua | |
parent | 1a9ce8b9c140867974de66f1f54178bbfb5df8c7 (diff) |
Fix transpose and rotate
Diffstat (limited to 'functions.lua')
-rw-r--r-- | functions.lua | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/functions.lua b/functions.lua index 425a6ac..ea10760 100644 --- a/functions.lua +++ b/functions.lua @@ -340,13 +340,13 @@ worldedit.transpose = function(pos1, pos2, axis1, axis2) local node1 = env:get_node(pos)
local meta1a = env:get_meta(pos):to_table()
local value1, value2 = pos[axis1], pos[axis2]
- pos[axis1], pos[axis2] = pos1[axis1] + extent1, pos1[axis2] + extent2
+ pos[axis1], pos[axis2] = pos1[axis1] + extent2, pos1[axis2] + extent1
local node2 = env:get_node(pos)
local meta2a = env:get_meta(pos):to_table()
env:add_node(pos, node1)
local meta1b = env:get_meta(pos)
meta1b:from_table(meta1a)
- pos[axis1], pos[axis2] = value1, value2
+ pos[axis1], pos[axis2] = pos1[axis1] + extent1, pos1[axis2] + extent2
env:add_node(pos, node2)
local meta2b = env:get_meta(pos)
meta2b:from_table(meta2a)
@@ -408,16 +408,12 @@ worldedit.rotate = function(pos1, pos2, angle) if angle == 90 then
worldedit.transpose(pos1, pos2, "x", "z")
- pos1.x, pos1.z = pos1.z, pos1.x
- pos2.x, pos2.z = pos2.z, pos2.x
worldedit.flip(pos1, pos2, "z")
elseif angle == 180 then
worldedit.flip(pos1, pos2, "x")
worldedit.flip(pos1, pos2, "z")
elseif angle == 270 then
worldedit.transpose(pos1, pos2, "x", "z")
- pos1.x, pos1.z = pos1.z, pos1.x
- pos2.x, pos2.z = pos2.z, pos2.x
worldedit.flip(pos1, pos2, "x")
else
return 0
|