From 5118cc42bb7efc5712ac11d63c5fe882030889a2 Mon Sep 17 00:00:00 2001 From: David Briscoe Date: Wed, 2 Mar 2022 23:53:11 -0800 Subject: [PATCH] lint: Fix mismatched arguments in circle_aabb Fix bug where circle_aabb_overlap wouldn't have the same results as aabb_circle_overlap. b_hs was unused, but the function we call expects a_hs as the first argument. Looks like this circle_aabb_overlap is just flipping the arguments to aabb_circle_overlap (and for circle_aabb_collide), so it should match arguments. Not sure what hs means. Box size? --- .luacheckrc | 1 - intersect.lua | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index 2805ba7..95c5344 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -2,7 +2,6 @@ return { std = "lua51+love", ignore = { "211", -- Unused local variable. - "212", -- Unused argument. "212/self", -- Unused argument self. "213", -- Unused loop variable. "311", -- Value assigned to a local variable is unused. diff --git a/intersect.lua b/intersect.lua index a6f3ca5..4e62e7d 100644 --- a/intersect.lua +++ b/intersect.lua @@ -454,11 +454,11 @@ function intersect.point_aabb_collide(a, b_pos, b_hs, into) end function intersect.circle_aabb_overlap(a, a_rad, b_pos, b_hs) - return intersect.aabb_circle_overlap(b_pos, b_pos, a, a_rad) + return intersect.aabb_circle_overlap(b_pos, b_hs, a, a_rad) end function intersect.circle_aabb_collide(a, a_rad, b_pos, b_hs, into) - return intersect.reverse_msv(intersect.aabb_circle_collide(b_pos, b_pos, a, a_rad, into)) + return intersect.reverse_msv(intersect.aabb_circle_collide(b_pos, b_hs, a, a_rad, into)) end function intersect.circle_line_collide(a, a_rad, b_start, b_end, b_rad, into)