diff options
-rw-r--r-- | cactus.lua | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -68,10 +68,14 @@ local function turn_to_face(newfacing) end local function moveby_xz(dv) - turn_to_face(vector.new(numutil.sign(dv.x), 0, 0)) - for i=1,math.abs(dv.x) do turtle.forward() end - turn_to_face(vector.new(0, 0, numutil.sign(dv.z))) - for i=1,math.abs(dv.z) do turtle.forward() end + if dv.x ~= 0 then + turn_to_face(vector.new(numutil.sign(dv.x), 0, 0)) + for i=1,math.abs(dv.x) do turtle.forward() end + end + if dv.z ~= 0 then + turn_to_face(vector.new(0, 0, numutil.sign(dv.z))) + for i=1,math.abs(dv.z) do turtle.forward() end + end end local function moveby(delta) |