Originally Posted by LanceDH
If it fine to have functions in the global space though?
For example my core file has a function to get your kills end some of the other files use that function.
|
Just put them in your addon's namespace. There's no reason to make everything a global. For example, if this is what you have now:
Code:
-- File A
function MyAddon_DoThings()
print("Doing things.")
end
-- File B
MyAddon_DoThings()
Change it to:
Code:
-- File A
local ADDON, private = ...
function private:DoThings()
print("Doing things without globals!")
end
-- File B
local ADDON, private = ...
private:DoThings()