From e1a9b21736a41b0d0d751d0ef8b44515375afc6e Mon Sep 17 00:00:00 2001 From: Das Keifer <43280661+DasKeifer@users.noreply.github.com> Date: Thu, 7 May 2026 22:29:18 -0400 Subject: [PATCH] Fixing legacy compatibility for old modutils with missing hooks. Before it would call the hooks multiple times --- scripts/internal.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/internal.lua b/scripts/internal.lua index bb8aa9f..f890cf4 100644 --- a/scripts/internal.lua +++ b/scripts/internal.lua @@ -27,7 +27,9 @@ function internal:buildBroadcastFunc(hooksField, argsFunc) end for i, extObj in ipairs(modApiExt_internal.extObjects) do - if extObj[hooksField] then + -- Only process hooks that are directly on this extObj, not inherited via metatable + -- This prevents proxies from accidentally firing hooks they don't actually support + if rawget(extObj, hooksField) then for j, hook in ipairs(extObj[hooksField]) do -- invoke the hook in a xpcall, since errors in SkillEffect -- scripts fail silently, making debugging a nightmare.