diff --git a/vmf/scripts/mods/vmf/modules/core/hooks.lua b/vmf/scripts/mods/vmf/modules/core/hooks.lua index 989c880..801a5de 100644 --- a/vmf/scripts/mods/vmf/modules/core/hooks.lua +++ b/vmf/scripts/mods/vmf/modules/core/hooks.lua @@ -289,6 +289,8 @@ local function generic_hook(mod, obj, method, handler, func_name) mod:error("(%s): trying to hook %s (a %s), not a function.", func_name, method, type(orig)) return end + + -- Edge Case: If someone hooks a copy of a function after its been hooked, point it back in the right direction if _registry.uids[orig] then orig = _registry.uids[orig] end @@ -328,8 +330,6 @@ local function generic_hook_toggle(mod, obj, method, enabled_state) end end - local orig = get_orig_function(obj, method) - if _registry[mod][obj[method]] then _registry[mod][obj[method]].active = enabled_state else