1
0
mirror of https://github.com/kepler155c/opus synced 2025-10-31 07:33:00 +00:00

spaces->tabs + cleanup + pathing fixes

This commit is contained in:
kepler155c@gmail.com
2019-06-18 15:19:24 -04:00
parent 82ec4db50f
commit 3c22a872b0
37 changed files with 1948 additions and 1703 deletions

View File

@@ -52,6 +52,7 @@ function turtle.resetState()
state.movePolicy = _defaultMove
state.moveCallback = noop
state.blacklist = nil
state.reference = nil -- gps reference when converting to relative coords
Pathing.reset()
return true
end
@@ -77,8 +78,6 @@ local function _dig(name, inspect, dig)
return dig()
end
-- override dig
-- optionally check that the block is a certain type
function turtle.dig(s)
return _dig(s, turtle.inspect, turtle.native.dig)
end
@@ -359,7 +358,7 @@ function turtle.set(args)
turtle.setDigPolicy(turtle.getPolicy(v))
elseif k == 'movePolicy' then
turtle.setMovePolicy(turtle.getPolicy(v))
state.movePolicy = turtle.getPolicy(v)
elseif k == 'movementStrategy' then
turtle.setMovementStrategy(v)
@@ -379,6 +378,9 @@ function turtle.set(args)
elseif k == 'blacklist' then
state.blacklist = v
elseif k == 'reference' then
state.reference = v
else
error('Invalid turle.set: ' .. tostring(k))
end
@@ -426,6 +428,10 @@ function turtle.setHeading(heading)
return false, 'Invalid heading'
end
if heading == turtle.point.heading then
return turtle.point
end
local fi = Point.facings[heading]
if not fi then
return false, 'Invalid heading'