Fix function to retrieve current loot specialization
This commit is contained in:
parent
565ad1da6e
commit
77b30de8f7
@ -31,19 +31,14 @@ end
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
T.GetLootSpec = function()
|
||||
local currentSpec = GetSpecialization()
|
||||
local currentSpecName = select(2, GetSpecializationInfo(currentSpec))
|
||||
local lootSpecID = GetLootSpecialization()
|
||||
local lootSpec = select(2, GetSpecializationInfoByID(lootSpecID))
|
||||
local currentSpec = GetSpecialization()
|
||||
local currentSpecName = currentSpec and select(2,GetSpecializationInfo(currentSpec)) or 'None'
|
||||
|
||||
-- if loot spec was manually set
|
||||
if lootSpec then
|
||||
return '|cnWHITE_FONT_COLOR:Loot:|r '..lootSpec..' '
|
||||
-- otherwise use current loot spec
|
||||
elseif currentSpec then
|
||||
return '|cnWHITE_FONT_COLOR:Loot:|r '..currentSpecName..' '
|
||||
if lootSpecID ~= 0 then
|
||||
return '|cnWHITE_FONT_COLOR:Loot:|r '..select(2, GetSpecializationInfoByID(lootSpecID))..' '
|
||||
else
|
||||
return ''
|
||||
return '|cnWHITE_FONT_COLOR:Loot:|r '..currentSpecName..' '
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user