variable rename

This commit is contained in:
telkar-rg
2023-12-02 23:43:14 +01:00
parent 26a1496d98
commit 3af3855be6
2 changed files with 17 additions and 7 deletions
+3 -3
View File
@@ -4199,7 +4199,7 @@ db.lootTable = {
}
local factionDuplicates = {
local recipeFactionDuplicates = {
Alliance = {
[4355] = {BZ["Hillsbrad Foothills"], format("%s: %s", L["Merchant"], "Micha Yance") }, -- Tailoring-Pattern: Icy Cloak
[6401] = {BZ["Duskwood"], format("%s: %s", L["Merchant"], "Sheri Zipstitch") }, -- Tailoring-Pattern: Dark Silk Shirt
@@ -4242,8 +4242,8 @@ local factionDuplicates = {
local playerFaction = UnitFactionGroup("player")
local zone,boss
if factionDuplicates[playerFaction] then
for k, v in pairs(factionDuplicates[playerFaction]) do
if recipeFactionDuplicates[playerFaction] then
for k, v in pairs(recipeFactionDuplicates[playerFaction]) do
zone = v[1]
boss = v[2]
if zone and boss then
@@ -485,12 +485,13 @@ local function ScanRecipes()
local char = addon.ThisCharacter
local profession = char.Professions[tradeskillName]
local crafts = profession.Crafts
wipe(crafts)
-- local crafts = profession.Crafts
-- wipe(crafts)
local crafts = {}
profession.FullLink = select(2, GetSpellLink(tradeskillName))
local NumCrafts = 0
local NumHeaders = 0
local color, craftInfo, link
for i = 1, GetNumTradeSkills() do
@@ -499,6 +500,7 @@ local function ScanRecipes()
if skillType == "header" then
craftInfo = skillName or ""
NumHeaders = NumHeaders + 1
else
link = GetTradeSkillRecipeLink(i)
craftInfo = tonumber(link:match("enchant:(%d+)")) -- this actually extracts the spellID
@@ -507,7 +509,15 @@ local function ScanRecipes()
crafts[i] = color .. "|" .. craftInfo
end
profession.NumCrafts = NumCrafts
if NumHeaders > 0 then -- only overwrite stored info if he have seen some headers (indicator that the whole profession is in game cache and the interface is shown in its entirety)
profession.FullLink = select(2, GetSpellLink(tradeskillName))
profession.NumCrafts = NumCrafts
wipe(profession.Crafts) -- wipe old table (for memory saving)
profession.Crafts = crafts -- assign the valid new table
else
wipe(crafts) -- wipe unused table
print(format("|cffFFFF20%s|r:",addonName), "Profession not yet fully loaded.")
end
end
local function ScanTradeSkills()