From c3392c159377cbb2da048285e03455f237aed550 Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Wed, 25 Jan 2023 15:10:29 +1100 Subject: [PATCH] refactor(client): trigger canInteract with a protected call --- client/main.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index e63ec8f..635303d 100644 --- a/client/main.lua +++ b/client/main.lua @@ -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