mirror of
https://github.com/kepler155c/opus
synced 2024-11-05 00:16:16 +00:00
dont require heading for point.closest
This commit is contained in:
parent
f5294d4fce
commit
b761b3429a
@ -177,7 +177,12 @@ function Point.closest(reference, pts)
|
||||
local lm, lpt = math.huge
|
||||
for _,pt in pairs(pts) do
|
||||
local distance = Point.turtleDistance(reference, pt)
|
||||
if not reference.heading then
|
||||
if distance < lm then
|
||||
lpt = pt
|
||||
lm = distance
|
||||
end
|
||||
elseif distance < lm then
|
||||
local _, _, m = Point.calculateMoves(reference, pt, distance)
|
||||
if m < lm then
|
||||
lpt = pt
|
||||
|
Loading…
Reference in New Issue
Block a user