Originally Posted by Wandamey
|
What merlight is referring to is my failure to properly use it in sidWarTools.
It worked as expected for the transition on one update, but I didn't update sidWarTools for a long time and then the next update came along and suddenly there was an error that wasn't there before, because one file was missing.
So the proper way to use it, is to provide the files for the next api version without the use of $(APIVersion) and the old files with it like this:
Code:
myAddon.lua
myAddon_$(APIVersion).lua
And inside the file you wrap the code into a function MyAddon.Initialize that gets executed from a third file (e.g. startup).
When launched with the old update, the myAddon_100013.lua is loaded and overwrites the function for the new version and once the new api version is available, myAddon_100014.lua is not found and the version from myAddon.lua is executed instead. It won't suddenly stop working because of a missing file in the future api versions either. Hope this makes it clear.