From 6ca1ac6f7b5c756f68c773675d2ac701154be489 Mon Sep 17 00:00:00 2001 From: Kai Vogelgesang Date: Wed, 8 Jul 2020 13:11:40 +0200 Subject: [PATCH] Debug --- kai/woodfarm.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kai/woodfarm.lua b/kai/woodfarm.lua index 86f4f88..f6fa4a4 100644 --- a/kai/woodfarm.lua +++ b/kai/woodfarm.lua @@ -111,19 +111,22 @@ local state_machine = { local x, z = calculate_tree_position(T.state.current_row, T.state.current_tree) local o - if T.state.current_tree > 12 then + if T.state.current_tree < 3 or T.state.current_tree > 12 then breakpoint() end if T.state.current_row ~= 1 and T.state.current_tree == 1 then + print("new row") -- 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 == 0 then + print("even row") -- we are in an even row and approaching in positive z direction z = z - 1 o = "+z" else + print("odd row") -- we are approaching in negative z direction z = z + 1 o = "-z"