From d193a4acbebd2b22dfaaa72c44b44cc9645c4bdf Mon Sep 17 00:00:00 2001 From: ElCeejo <40281901+ElCeejo@users.noreply.github.com> Date: Fri, 17 Jun 2022 23:51:40 -0700 Subject: [PATCH] No more luacheck warnings --- pathfinder.lua | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/pathfinder.lua b/pathfinder.lua index 53dd1f3..f7ad384 100644 --- a/pathfinder.lua +++ b/pathfinder.lua @@ -211,15 +211,7 @@ function creatura.find_path(self, start, goal, obj_width, obj_height, max_open, return end -- Initialize ID and data - local current_id - local current - - -- Get an initial id in open set - for i, v in pairs(openSet) do - current_id = i - current = v - break - end + local current_id, current = next(openSet) -- Find lowest f cost for i, v in pairs(openSet) do @@ -430,15 +422,7 @@ function creatura.find_theta_path(self, start, goal, obj_width, obj_height, max_ end -- Initialize ID and data - local current_id - local current - - -- Get an initial id in open set - for i, v in pairs(openSet) do - current_id = i - current = v - break - end + local current_id, current = next(openSet) -- Find lowest f cost for i, v in pairs(openSet) do