Quantcast

-Fixed an issue with stored professions not picking up certain secondary tradeskills.

Xruptor [04-01-12 - 12:17]
-Fixed an issue with stored professions not picking up certain secondary tradeskills.
-Removed getglobal as it's been depreciated.
Filename
BagSync.lua
BagSync.toc
diff --git a/BagSync.lua b/BagSync.lua
index c161a5e..3c48b79 100644
--- a/BagSync.lua
+++ b/BagSync.lua
@@ -225,13 +225,6 @@ end
 --      Local       --
 ----------------------

---list of tradeskills with NO skill link but can be used as primaries (ex. a person with two gathering skills)
-local noLinkTS = {
-	["Interface\Icons\Trade_Herbalism"] = true, --this is Herbalism
-	["Interface\Icons\INV_Misc_Pelt_Wolf_01"] = true, --this is Skinning
-	["Interface\Icons\INV_Pick_02"] = true, --this is Mining
-}
-
 local function doRegularTradeSkill(numIndex, dbIdx)
 	local name, icon, skillLevel, maxSkillLevel, numAbilities, spelloffset, skillLine, skillModifier = GetProfessionInfo(numIndex)
 	if name and skillLevel then
@@ -650,7 +643,7 @@ local function buildMoneyString(money, color)
 end

 function BagSync:ShowMoneyTooltip()
-	local tooltip = getglobal("BagSyncMoneyTooltip") or nil
+	local tooltip = _G["BagSyncMoneyTooltip"] or nil

 	if (not tooltip) then
 			tooltip = CreateFrame("GameTooltip", "BagSyncMoneyTooltip", UIParent, "GameTooltipTemplate")
@@ -1431,13 +1424,22 @@ function BagSync:TRADE_SKILL_SHOW()

 		local tradename = _G.GetTradeSkillLine()
 		local prof1, prof2, archaeology, fishing, cooking, firstAid = GetProfessions()
-		if not tradename then return end
+
+		local iconProf1 = prof1 and select(2, GetProfessionInfo(prof1))
+		local iconProf2 = prof2 and select(2, GetProfessionInfo(prof2))
+
+		--list of tradeskills with NO skill link but can be used as primaries (ex. a person with two gathering skills)
+		local noLinkTS = {
+			["Interface\\Icons\\Trade_Herbalism"] = true, --this is Herbalism
+			["Interface\\Icons\\INV_Misc_Pelt_Wolf_01"] = true, --this is Skinning
+			["Interface\\Icons\\INV_Pick_02"] = true, --this is Mining
+		}

 		--prof1
 		if prof1 and (GetProfessionInfo(prof1) == tradename) and GetTradeSkillListLink() then
 			local skill = select(3, GetProfessionInfo(prof1))
 			BS_CD[1] = { tradename, GetTradeSkillListLink(), skill }
-		elseif prof1 and select(2, GetProfessionInfo(prof1)) and noLinkTS[select(2, GetProfessionInfo(prof1))] then
+		elseif prof1 and iconProf1 and noLinkTS[iconProf1] then
 			--only store if it's herbalism, skinning, or mining
 			doRegularTradeSkill(prof1, 1)
 		elseif not prof1 and BS_CD[1] then
@@ -1449,7 +1451,7 @@ function BagSync:TRADE_SKILL_SHOW()
 		if prof2 and (GetProfessionInfo(prof2) == tradename) and GetTradeSkillListLink() then
 			local skill = select(3, GetProfessionInfo(prof2))
 			BS_CD[2] = { tradename, GetTradeSkillListLink(), skill }
-		elseif prof2 and select(2, GetProfessionInfo(prof2)) and noLinkTS[select(2, GetProfessionInfo(prof2))] then
+		elseif prof2 and iconProf2 and noLinkTS[iconProf2] then
 			--only store if it's herbalism, skinning, or mining
 			doRegularTradeSkill(prof2, 2)
 		elseif not prof2 and BS_CD[2] then
diff --git a/BagSync.toc b/BagSync.toc
index 9fbc944..b0c0803 100644
--- a/BagSync.toc
+++ b/BagSync.toc
@@ -2,7 +2,7 @@
 ## Title: BagSync
 ## Notes: BagSync tracks your characters items and displays it within tooltips.
 ## Author: Xruptor
-## Version: 6.7.2
+## Version: 6.7.3
 ## SavedVariables: BagSyncDB, BagSyncOpt, BagSyncGUILD_DB, BagSyncTOKEN_DB, BagSyncCRAFT_DB, BagSyncBLACKLIST_DB

 localization\localization.lua