From 850bfdf0530ef9cbb6143e1e91b78ea7e2e42497 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Thu, 4 Jul 2024 23:03:25 +0200 Subject: [PATCH] added missing local declaration --- src/util/SearchLib.ttslua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/util/SearchLib.ttslua b/src/util/SearchLib.ttslua index 6280ab80..7d5d5fa7 100644 --- a/src/util/SearchLib.ttslua +++ b/src/util/SearchLib.ttslua @@ -30,7 +30,7 @@ do max_distance = maxDistance or 0 }) - -- filtering the result + -- filter the result for matching objects local objList = {} for _, v in ipairs(searchResult) do if not filter or filterFunc(v.hit_object) then @@ -47,22 +47,22 @@ do -- searches the area on an object SearchLib.onObject = function(obj, filter) - pos = obj.getPosition() - size = obj.getBounds().size:setAt("y", 1) + local pos = obj.getPosition() + local size = obj.getBounds().size:setAt("y", 1) return returnSearchResult(pos, _, size, filter) end -- searches the specified position (a single point) SearchLib.atPosition = function(pos, filter) - size = { 0.1, 2, 0.1 } + local size = { 0.1, 2, 0.1 } return returnSearchResult(pos, _, size, filter) end -- searches below the specified position (downwards until y = 0) SearchLib.belowPosition = function(pos, filter) - size = { 0.1, 2, 0.1 } - direction = { 0, -1, 0 } - maxDistance = pos.y + local size = { 0.1, 2, 0.1 } + local direction = { 0, -1, 0 } + local maxDistance = pos.y return returnSearchResult(pos, _, size, filter, direction, maxDistance) end