added missing local declaration

This commit is contained in:
Chr1Z93 2024-07-04 23:03:25 +02:00
parent 5c53ca9c9c
commit 850bfdf053

View File

@ -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