diff options
author | ubq323 <ubq323@ubq323.website> | 2024-04-04 00:34:54 +0100 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2024-04-04 00:34:54 +0100 |
commit | 8de5a7af338ee389df076fb3451f4009db2fa26e (patch) | |
tree | 0855ed1c1ac93e9531d84da4e35bd05f96ccb66a | |
parent | 4a0f1a1d5f80d59a0c60b41391979bfb3d73dff3 (diff) |
launch cactus
-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) |