Originally Posted by Resike
Except you are not hooking a function call, but a call for it's memory pointer's reference.
|
Well of course if you explicitly do
not use a pointer created before hooking it's going to work, but no, as I've recently learnt,
hooksecurefunc actually replaces the function and there's no magic at all.
This does not print anything:
Code:
local SetCVar = SetCVar
hooksecurefunc("SetCVar", function(name, value)
if name == "Sound_EnableMusic" then
print(name, value)
end
end)
SetCVar("Sound_EnableMusic", 1)