How could this be written neater?
View Single Post
05-09-17, 01:37 AM
A Rage Talon Dragon Guard
Join Date: Sep 2012
Originally Posted by
I can fully understand code paranoia. During a testing phase of Decliner, the friend helping me said it didn't work. After some investigation, having them use /dump on my main player check function returned nil, but it returned a function for me. I double-checked they were using the exact same /dump string and that my addon was loaded.
My answer was to move the check function to a local and then make a global dummy function that returns the check function. The worst part was the integration into a timer loop I use to check the global dummy every five seconds and reinitialize it if it's nil, while trying to out the addon deleting it with ADDON_LOADED. I recently removed that part of the timer loop actually, but I still hide the main check function locally, while the global dummy is just an API thing I keep.
Paranoia aside, I still learned that I shouldn't have important functions outside my addon's scope.
Been there, done that T_T Some devs are... Ugh
View Public Profile
Send a private message to lightspark
Find More Posts by lightspark