Skip to content

Commit

Permalink
refactor(client): trigger canInteract with a protected call
Browse files Browse the repository at this point in the history
  • Loading branch information
thelindat committed Jan 25, 2023
1 parent 4ce8292 commit c3392c1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ local function enableTargeting()
end

if not hide and option.canInteract then
hide = not option.canInteract(entityHit, distance, endCoords, option.name, bone)
local success, resp = pcall(option.canInteract, entityHit, distance, endCoords, option.name, bone)
hide = not success or not resp
end

if not newOptions and v[i].hide ~= hide then
Expand Down

0 comments on commit c3392c1

Please sign in to comment.