summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2024-04-04 00:34:54 +0100
committerubq323 <ubq323@ubq323.website>2024-04-04 00:34:54 +0100
commit8de5a7af338ee389df076fb3451f4009db2fa26e (patch)
tree0855ed1c1ac93e9531d84da4e35bd05f96ccb66a
parent4a0f1a1d5f80d59a0c60b41391979bfb3d73dff3 (diff)
launch cactus
-rw-r--r--cactus.lua12
1 files changed, 8 insertions, 4 deletions
diff --git a/cactus.lua b/cactus.lua
index 83b3f58..0934d55 100644
--- a/cactus.lua
+++ b/cactus.lua
@@ -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)