So a variable declared in a LOCAL function is still GLOBAL!? That's surprising and it means my function from earlier needs to be messy...
Code:
function test()
local name,stack,duration,timeleft
if IS_WRATH then
name,_,_,stack,_,duration,timeleft = UnitBuff(target,n)
else
name,_,_,stack,duration,timeleft = UnitBuff(target,n)
end
return name,stack,duration,timeleft
end
because
Code:
function test()
if IS_WRATH then
local name,_,_,stack,_,duration,timeleft = UnitBuff(target,n)
else
local name,_,_,stack,duration,timeleft = UnitBuff(target,n)
end
return name,stack,duration,timeleft
end
wouldn't work of course (those variables being 'local' to that if statement only!