From af919da379d0f38015bcbe16084e7c03ddecaa0d Mon Sep 17 00:00:00 2001 From: Max Cahill <1bardesign@gmail.com> Date: Thu, 17 Jun 2021 11:29:14 +1000 Subject: [PATCH] Fixed intersect.lua line functions not all working properly with un-exported batteries --- intersect.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/intersect.lua b/intersect.lua index bdb6824..2ba33a5 100644 --- a/intersect.lua +++ b/intersect.lua @@ -15,6 +15,7 @@ local path = (...):gsub("intersect", "") local vec2 = require(path .. "vec2") +local functional = require(path .. "functional") --module storage local intersect = {} @@ -219,7 +220,7 @@ function intersect.line_line_collide(a_start, a_end, a_rad, b_start, b_end, b_ra table.insert(search_tab, {intersect._line_to_point(a_start, a_end, b_end), -1}) end - local best = table.find_best(search_tab, function(v) + local best = functional.find_best(search_tab, function(v) return -(v[1]:length_squared()) end)