How to determine if it's safe to overwrite global Blizzard function
I want to rewrite global functions LocalizeFrames and CombatFeedback_OnCombatEvent. I can do just that:
Code:
function LocalizeFrames() |
The reason you should never overwrite Blizzard functions is because any AddOn that depends on them to work a specific way suddenly won't work, or at the very least won't work as expected. Don't forget that the entire Blizzard UI is a series of AddOns. Almost every AddOn written by fans (ex: ElvUI, anything from Curseforge/Twitch, or Wowinterface) access the Blizzard AddOns for functions, global variables, and other things. Overwriting Blizzard's code will break everything, eventually.
Securely hooking a function allows the original function to work and run, then your secure copy runs second, preserving all expected results. Tainting is unsecured code. Every AddOn not written by Blizzard is, by its existence, tainted. That's perfectly fine, but it gets messy when some author taints the code path with a stray global variable or a function that should have been hooked. The taint log is notoriously difficult to shift through to find the offending code. This is because of the order of things. I'm about to heavily generalize here, but it gets the point across:
I could elaborate more, as there is a great deal more to say on the matter, but the short version is: just because you don't see the problem doesn't mean the problem doesn't exist –– and eventually will cause failure. |
All times are GMT -6. The time now is 11:21 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI