Changed heading calculation.
This commit is contained in:
parent
0396caf149
commit
22acaca89f
@ -251,29 +251,27 @@ local function determineHeading()
|
||||
sendLog(FAILED, "Could not move to get delta.")
|
||||
return
|
||||
end
|
||||
if x == nil then
|
||||
if position == nil then
|
||||
sendLog(FAILED, "Could not locate.")
|
||||
return
|
||||
end
|
||||
heading = position - oldPos
|
||||
local fDelta = position - oldPos
|
||||
|
||||
|
||||
if not attemptMoveRight() then
|
||||
sendLog(FAILED, "Unable to rotate right.")
|
||||
heading = nil
|
||||
return
|
||||
end
|
||||
local oldPos = vector.new(position.x, position.y, position.z)
|
||||
if not attemptMoveForward() then
|
||||
sendLog(FAILED, "Unable to move forward after rotation.")
|
||||
heading = nil
|
||||
return
|
||||
end
|
||||
if not attemptMoveLeft() then
|
||||
sendLog(FAILED, "Unable to rotate left.")
|
||||
heading = nil
|
||||
return
|
||||
end
|
||||
heading = fDelta
|
||||
rightAxis = position - oldPos
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user