From 55f27d5496ea0860cce057f2ab96f9b34475df64 Mon Sep 17 00:00:00 2001 From: Parnic Date: Sun, 27 Jun 2021 20:57:36 -0500 Subject: [PATCH] Fix Class tag in Classic-Era Fixes #7 --- Categories/Characteristics.lua | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Categories/Characteristics.lua b/Categories/Characteristics.lua index a9363ff..ed1ade9 100644 --- a/Categories/Characteristics.lua +++ b/Categories/Characteristics.lua @@ -181,11 +181,17 @@ local function Class(unit) if UnitIsPlayer(unit) then return UnitClass(unit) or UNKNOWN else - if wow_800 or WOW_PROJECT_ID then - local classbase, classindex = UnitClassBase(unit) + local classbase, classindex = UnitClassBase(unit) + if (wow_800 or WOW_PROJECT_ID) and GetClassInfo then return classbase and GetClassInfo(classindex) or UNKNOWN + elseif LOCALIZED_CLASS_NAMES_MALE and LOCALIZED_CLASS_NAMES_FEMALE then + if UnitSex(unit) == 3 then + return LOCALIZED_CLASS_NAMES_FEMALE[classbase] or UNKNOWN + else + return LOCALIZED_CLASS_NAMES_MALE[classbase] or UNKNOWN + end else - return UnitClassBase(unit) or UNKNOWN + return classbase or UNKNOWN end end end