Make sure to restore original functions when reloading vmf.
This commit is contained in:
parent
f6baeb4ccd
commit
f195b10e7d
1 changed files with 13 additions and 2 deletions
|
@ -400,8 +400,19 @@ end
|
|||
-- ####################################################################################################################
|
||||
|
||||
-- -- removes all hooks when VMF is about to be reloaded
|
||||
-- vmf.hooks_unload = function()
|
||||
-- end
|
||||
vmf.hooks_unload = function()
|
||||
for key, value in pairs(_registry.origs) do
|
||||
-- origs[method] = orig
|
||||
if type(value) == "function" then
|
||||
_G[key] = value
|
||||
-- origs[obj][method] = orig
|
||||
elseif type(value) == "table" then
|
||||
for method, orig in pairs(value) do
|
||||
key[method] = orig
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
vmf.apply_delayed_hooks = function()
|
||||
if #_delayed > 0 then
|
||||
|
|
Loading…
Add table
Reference in a new issue