[Hooks] Fix inability to find original functions
This commit is contained in:
parent
16d72fc593
commit
d7f2d31897
1 changed files with 5 additions and 5 deletions
|
@ -316,7 +316,7 @@ local function generic_hook(mod, obj, method, handler, func_name)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- obj can't be a string for these now.
|
-- 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
|
if type(orig) ~= "function" then
|
||||||
mod:error("(%s): trying to hook %s (a %s), not a function.", func_name, method, type(orig))
|
mod:error("(%s): trying to hook %s (a %s), not a function.", func_name, method, type(orig))
|
||||||
return
|
return
|
||||||
|
@ -357,7 +357,7 @@ local function generic_hook_toggle(mod, obj, method, enabled_state)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local orig = get_orig_function(mod, obj, method)
|
local orig = get_orig_function(obj, method)
|
||||||
|
|
||||||
if _registry[mod][orig] then
|
if _registry[mod][orig] then
|
||||||
_registry[mod][orig].active = enabled_state
|
_registry[mod][orig].active = enabled_state
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue