From 5aae3ab55bdbc2e6eb3509e2994847590016778c Mon Sep 17 00:00:00 2001 From: Kai Vogelgesang Date: Wed, 8 Jul 2020 12:10:00 +0200 Subject: [PATCH] Oof Arrays start at 1 --- kai/woodfarm.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/kai/woodfarm.lua b/kai/woodfarm.lua index ea759fa..e19fe63 100644 --- a/kai/woodfarm.lua +++ b/kai/woodfarm.lua @@ -108,6 +108,10 @@ local state_machine = { -- we just turned towards a new row and are approaching in positive x direction x = x - 1 o = "+x" + elseif T.state.current_row % 2 == 1 then + -- we are in an even row and approaching in positive z direction + z = z - 1 + o = "+z" else -- we are approaching in negative z direction z = z + 1 @@ -222,8 +226,8 @@ local state_machine = { turtle.refuel() end - T.state.current_row = 0 - T.state.current_tree = 0 + T.state.current_row = 1 + T.state.current_tree = 1 return "MOVE_TO_TREE" end,