[Hooks] Fix inability to find original functions

This commit is contained in:
Azumgi 2018-08-21 09:30:38 +03:00
parent 16d72fc593
commit d7f2d31897

View file

@ -316,7 +316,7 @@ local function generic_hook(mod, obj, method, handler, func_name)
end
-- obj can't be a string for these now.
local orig = get_orig_function(mod, obj, method)
local orig = get_orig_function(obj, method)
if type(orig) ~= "function" then
mod:error("(%s): trying to hook %s (a %s), not a function.", func_name, method, type(orig))
return
@ -357,7 +357,7 @@ local function generic_hook_toggle(mod, obj, method, enabled_state)
end
end
local orig = get_orig_function(mod, obj, method)
local orig = get_orig_function(obj, method)
if _registry[mod][orig] then
_registry[mod][orig].active = enabled_state