Originally Posted by Lombra
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)
|
It makes no sense, you are saying this hook actually killing the functionality of the SetCVar calls? It also works as a described and prints the value regardless how and where do you upvalue it.