This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
What steps will reproduce the problem?
What is the expected output? What do you see instead?
What version of the product are you using?
Do you have an error log of what happened?
5x Broker_HitCrit\Broker_HitCrit-2.22.3-release.lua:2349: Usage: GetSpecializationInfo(specIndex[, isInspect[, isPet]]) <in C code> Broker_HitCrit\Broker_HitCrit-2.22.3-release.lua:2349: in function <Broker_HitCrit\Broker_HitCrit.lua:2343> (tail call): ? <in C code> <string>:"safecall Dispatcher[1]":9: in function <string>:"safecall Dispatcher[1]":5 (tail call): ? AdiBags-v1.6.12-beta-1\libs\AceAddon-3.0\AceAddon-3.0-12.lua:558: in function "EnableAddon" AdiBags-v1.6.12-beta-1\libs\AceAddon-3.0\AceAddon-3.0-12.lua:651: in function <AdiBags\libs\AceAddon-3.0\AceAddon-3.0.lua:636> <in C code> <in C code> AddonLoader\AddonLoader-r126.lua:125: in function "LoadAddOn" AddonLoader-r126\Conditions.lua:142: in function <AddonLoader\Conditions.lua:130> AddonLoader-r126\Conditions.lua:162: in function <AddonLoader\Conditions.lua:149> Locals: nil
Please provide any additional information below.
This patch might help to resolve this. I opted to file the untalented results under the Inactive Spec, it will be overwritten from level 10 onwards anyway, so little need to create a new data section solely for level 1-9.
I reasoned that the drawing of the tooltip happens infrequently enough that putting the call in that function would not be an issue for slow downs or the likes.
diff --git a/Broker_HitCrit.lua b/Broker_HitCrit.lua index 4b5fbc4..517e5a3 100644 --- a/Broker_HitCrit.lua +++ b/Broker_HitCrit.lua @@ -785,7 +785,8 @@ function addon:drawTooltip( talent ) tooltip:Clear() tooltip:SetColumnLayout(num_columns, unpack(t)) - if talent == HitCrit.activeTalents then + self:getSpecializationName() + if talent == HitCrit.activeTalents and HitCrit.specName ~= "" then headerTitle = HitCrit_White( L["Broker_HitCrit"] .. " - " .. HitCrit.specName ) else headerTitle = HitCrit_White( L["Broker_HitCrit"] .. " - " .. L["Inactive Spec"] ) @@ -2304,6 +2305,13 @@ function addon:checkSuperBuffs() end end +function addon:getSpecializationName() + local specialization = GetSpecialization() + if (specialization) then + HitCrit.specName = select(2, GetSpecializationInfo(specialization)) + end +end + function HitCrit:UNIT_AURA( ... ) HitCrit_Debug( "Player unit aura event fired" ) HitCrit:checkSuperBuffs() @@ -2322,7 +2330,7 @@ end function HitCrit:ACTIVE_TALENT_GROUP_CHANGED( ... ) HitCrit_Debug( "Player talents switched" ) HitCrit.activeTalents = GetActiveSpecGroup() - HitCrit.specName = select(2, GetSpecializationInfo(GetSpecialization())) + self:getSpecializationName() HitCrit.currTT = HitCrit.activeTalents end @@ -2346,7 +2354,7 @@ function HitCrit:OnEnable() HitCrit.GUID = UnitGUID( "player" ) HitCrit.level = UnitLevel( "player" ) HitCrit.activeTalents = GetActiveSpecGroup() - HitCrit.specName = select(2, GetSpecializationInfo(GetSpecialization())) + self:getSpecializationName() HitCrit.currTT = HitCrit.activeTalents self.db = LibStub( "AceDB-3.0" ):New( "HitCrit_DB", nil, "Default" )
To post a comment, please login or register a new account.