Quantcast
WoWInterface - View Single Post - About add-ons optimization
View Single Post
01-16-18, 02:28 PM   #64
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
Originally Posted by Resike View Post
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.
No, I'm saying a new function is defined. You may verify using this:

Code:
/run local a = SetCVar hooksecurefunc("SetCVar", function(name, value) if name == "Sound_EnableMusic" then print(name, value) end end) print(a == SetCVar)
My code does not print anything on login for me, nor does this macro: (don't use together with the addon code as it will upvalue the already hooked function)

Code:
/run local a = SetCVar hooksecurefunc("SetCVar", function(name, value) if name == "Sound_EnableMusic" then print(name, value) end end) a("Sound_EnableMusic", 1)
And regardless, the point still stands for insecure hooks, and whether those are a good idea or not wasn't the point.
__________________
Grab your sword and fight the Horde!
  Reply With Quote