Originally Posted by Slakah
They're global functions so it wont make a difference.
|
Yes it will; since the reference will be nil when the code runs, it doesn't matter how they're defined later. You're thinking of a slightly different compile-time error; but in this case the code is top-level and those lines will actually *run* while the function names are still nil references.
However, it would be better if they were not global anyway:
Code:
local function toggleHelm()
ShowHelm(not ShowingHelm())
end
local function toggleCloak()
ShowCloak(not ShowingCloak())
end
SLASH_TOGGLEHELM1 = "/toggleHelm"
SLASH_TOGGLECLOAK1 = "/toggleCloak"
SlashCmdList["TOGGLEHELM"] = toggleHelm
SlashCmdList["TOGGLECLOAK"] = toggleCloak