diff options
author | FaceDeer <derksenmobile@gmail.com> | 2017-01-14 16:58:37 -0700 |
---|---|---|
committer | FaceDeer <derksenmobile@gmail.com> | 2017-01-14 16:58:37 -0700 |
commit | 51c5e9b6417b807ea3b7890240bd2ea43e8a297a (patch) | |
tree | 94c33a1c482b4509d10b31a3e260b1f187aaad53 /util.lua | |
parent | f0e09f136a40efa7ebf41db880693b67b3f9f628 (diff) |
Diagonal movement setting for the auto-controller.
Diffstat (limited to 'util.lua')
-rw-r--r-- | util.lua | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -19,16 +19,18 @@ digtron.find_new_pos = function(pos, facing) return vector.add(pos, dir) end -digtron.find_new_pos_downward = function(pos, facing) - local downdir = ( +digtron.facedir_to_down_dir = function(facing) + return ( {[0]={x=0, y=-1, z=0}, {x=0, y=0, z=-1}, {x=0, y=0, z=1}, {x=-1, y=0, z=0}, {x=1, y=0, z=0}, {x=0, y=1, z=0}})[math.floor(facing/4)] - return vector.add(pos, downdir) +end +digtron.find_new_pos_downward = function(pos, facing) + return vector.add(pos, digtron.facedir_to_down_dir(facing)) end digtron.mark_diggable = function(pos, nodes_dug) |