From a18cae186abab43d1a50bc2bf79194e603520b3a Mon Sep 17 00:00:00 2001 From: "James D. Callahan III" Date: Tue, 8 Mar 2011 03:21:50 -0600 Subject: [PATCH 1/3] Revert "After initializing the recipes, nil the profession entry from private.profession_init_funcs" This reverts commit 28624d6a4590a854e0c51cc8457b9e9cb2ee793f. --- Database/Alchemy.lua | 1 - Database/Blacksmithing.lua | 1 - Database/Cooking.lua | 1 - Database/Enchanting.lua | 1 - Database/Engineering.lua | 1 - Database/FirstAid.lua | 1 - Database/Inscription.lua | 1 - Database/Jewelcrafting.lua | 1 - Database/Leatherworking.lua | 1 - Database/Runeforging.lua | 1 - Database/Smelting.lua | 1 - Database/Tailoring.lua | 1 - 12 files changed, 12 deletions(-) diff --git a/Database/Alchemy.lua b/Database/Alchemy.lua index 9362e06..569f3ad 100644 --- a/Database/Alchemy.lua +++ b/Database/Alchemy.lua @@ -1538,5 +1538,4 @@ function addon:InitAlchemy() recipe:AddTrainer(1386, 2132, 3009, 3184, 3347, 4160, 4611, 5177, 5499, 26951, 26975, 27023, 27029, 28703, 33588) self.InitAlchemy = nil - private.profession_init_funcs[recipe.profession] = nil end diff --git a/Database/Blacksmithing.lua b/Database/Blacksmithing.lua index af3ad3b..e92c149 100644 --- a/Database/Blacksmithing.lua +++ b/Database/Blacksmithing.lua @@ -2924,5 +2924,4 @@ function addon:InitBlacksmithing() recipe:AddVendor(50375, 50382) self.InitBlacksmithing = nil - private.profession_init_funcs[recipe.profession] = nil end diff --git a/Database/Cooking.lua b/Database/Cooking.lua index 49bbc32..bd07b3b 100644 --- a/Database/Cooking.lua +++ b/Database/Cooking.lua @@ -1111,5 +1111,4 @@ function addon:InitCooking() recipe:AddSeason(5) self.InitCooking = nil - private.profession_init_funcs[recipe.profession] = nil end diff --git a/Database/Enchanting.lua b/Database/Enchanting.lua index a46e540..450dc5d 100644 --- a/Database/Enchanting.lua +++ b/Database/Enchanting.lua @@ -1808,5 +1808,4 @@ function addon:InitEnchanting() recipe:AddWorldDrop("Deepholm", "Eastern Kingdoms", "Kalimdor") self.InitEnchanting = nil - private.profession_init_funcs[recipe.profession] = nil end diff --git a/Database/Engineering.lua b/Database/Engineering.lua index e6393d5..17e6a99 100644 --- a/Database/Engineering.lua +++ b/Database/Engineering.lua @@ -1658,5 +1658,4 @@ function addon:InitEngineering() recipe:AddTrainer(5518, 11017) self.InitEngineering = nil - private.profession_init_funcs[recipe.profession] = nil end diff --git a/Database/FirstAid.lua b/Database/FirstAid.lua index cd44d97..c19d4e3 100644 --- a/Database/FirstAid.lua +++ b/Database/FirstAid.lua @@ -149,5 +149,4 @@ function addon:InitFirstAid() recipe:AddTrainer(2326, 2327, 2329, 2798, 3181, 4211, 4591, 5150, 5759, 5939, 5943, 6094, 16272, 16662, 16731, 17214, 17424, 18990, 18991, 19184, 19478, 22477, 23734, 26956, 26992, 28706, 29233, 33589, 33621, 45540, 49879, 50574) self.InitFirstAid = nil - private.profession_init_funcs[recipe.profession] = nil end diff --git a/Database/Inscription.lua b/Database/Inscription.lua index 02b6700..e40d0a6 100644 --- a/Database/Inscription.lua +++ b/Database/Inscription.lua @@ -2375,5 +2375,4 @@ function addon:InitInscription() recipe:AddTrainer(28702, 30706, 30711, 30713, 30715, 30717, 46716) self.InitInscription = nil - private.profession_init_funcs[recipe.profession] = nil end diff --git a/Database/Jewelcrafting.lua b/Database/Jewelcrafting.lua index 85759e7..f771cd1 100644 --- a/Database/Jewelcrafting.lua +++ b/Database/Jewelcrafting.lua @@ -3010,5 +3010,4 @@ function addon:InitJewelcrafting() recipe:AddWorldDrop("Deepholm", "Eastern Kingdoms", "Kalimdor") self.InitJewelcrafting = nil - private.profession_init_funcs[recipe.profession] = nil end diff --git a/Database/Leatherworking.lua b/Database/Leatherworking.lua index 66b4e27..99c60d2 100644 --- a/Database/Leatherworking.lua +++ b/Database/Leatherworking.lua @@ -3063,6 +3063,5 @@ function addon:InitLeatherworking() recipe:AddTrainer(3007, 3365, 3967, 4212, 4588, 5127, 5564, 26998, 28700, 29507, 33581) self.InitLeatherworking = nil - private.profession_init_funcs[recipe.profession] = nil end diff --git a/Database/Runeforging.lua b/Database/Runeforging.lua index e0ae0d2..afa8087 100644 --- a/Database/Runeforging.lua +++ b/Database/Runeforging.lua @@ -92,5 +92,4 @@ function addon:InitRuneforging() recipe:AddTrainer(29194, 29195, 29196, 31084) self.InitRuneforging = nil - private.profession_init_funcs[recipe.profession] = nil end diff --git a/Database/Smelting.lua b/Database/Smelting.lua index a669d12..a78e0b8 100644 --- a/Database/Smelting.lua +++ b/Database/Smelting.lua @@ -191,5 +191,4 @@ function addon:InitSmelting() recipe:AddTrainer(3357, 4254, 5513, 16663) self.InitSmelting = nil - private.profession_init_funcs[recipe.profession] = nil end diff --git a/Database/Tailoring.lua b/Database/Tailoring.lua index 14c749a..a8c02c5 100644 --- a/Database/Tailoring.lua +++ b/Database/Tailoring.lua @@ -2416,5 +2416,4 @@ function addon:InitTailoring() recipe:AddTrainer(1346, 3363, 4159, 4576, 5153, 9584, 16640, 28699, 33613, 44783, 45559) self.InitTailoring = nil - private.profession_init_funcs[recipe.profession] = nil end -- 1.7.9.5 From c05a83ab07c7206c52bd8362d41a4ea5227a5451 Mon Sep 17 00:00:00 2001 From: "James D. Callahan III" Date: Tue, 8 Mar 2011 03:22:25 -0600 Subject: [PATCH 2/3] Fuck the retarded shit. Nuke the reference as soon as it's used. --- core.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/core.lua b/core.lua index fdb6ac0..eedda8c 100644 --- a/core.lua +++ b/core.lua @@ -911,6 +911,7 @@ function addon:InitializeProfession(profession) if func then func(addon) + private.profession_init_funcs[profession] = nil end end -- 1.7.9.5 From 336825f8ea8e334dfb4ef119fb136aeb80000065 Mon Sep 17 00:00:00 2001 From: "James D. Callahan III" Date: Tue, 8 Mar 2011 03:38:29 -0600 Subject: [PATCH 3/3] Revert "PROFESSION_INIT_FUNCS --> private.profession_init_funcs" This reverts commit 2dddab50eda131c78afe0da7d7a5162aad3dd1f9. --- core.lua | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/core.lua b/core.lua index eedda8c..1bba3f5 100644 --- a/core.lua +++ b/core.lua @@ -72,7 +72,7 @@ private.acquire_list = {} ------------------------------------------------------------------------------ -- Constants. ------------------------------------------------------------------------------ -private.profession_init_funcs = {} +local PROFESSION_INIT_FUNCS = {} ------------------------------------------------------------------------------ -- Database tables @@ -533,18 +533,18 @@ function addon:OnInitialize() ------------------------------------------------------------------------------- -- Populate the profession initialization functions. ------------------------------------------------------------------------------- - private.profession_init_funcs[_G.GetSpellInfo(51304)] = addon.InitAlchemy - private.profession_init_funcs[_G.GetSpellInfo(51300)] = addon.InitBlacksmithing - private.profession_init_funcs[_G.GetSpellInfo(51296)] = addon.InitCooking - private.profession_init_funcs[_G.GetSpellInfo(51313)] = addon.InitEnchanting - private.profession_init_funcs[_G.GetSpellInfo(51306)] = addon.InitEngineering - private.profession_init_funcs[_G.GetSpellInfo(45542)] = addon.InitFirstAid - private.profession_init_funcs[_G.GetSpellInfo(51302)] = addon.InitLeatherworking - private.profession_init_funcs[_G.GetSpellInfo(32606)] = addon.InitSmelting - private.profession_init_funcs[_G.GetSpellInfo(51309)] = addon.InitTailoring - private.profession_init_funcs[_G.GetSpellInfo(51311)] = addon.InitJewelcrafting - private.profession_init_funcs[_G.GetSpellInfo(45363)] = addon.InitInscription - private.profession_init_funcs[private.runeforging_name] = addon.InitRuneforging + PROFESSION_INIT_FUNCS[_G.GetSpellInfo(51304)] = addon.InitAlchemy + PROFESSION_INIT_FUNCS[_G.GetSpellInfo(51300)] = addon.InitBlacksmithing + PROFESSION_INIT_FUNCS[_G.GetSpellInfo(51296)] = addon.InitCooking + PROFESSION_INIT_FUNCS[_G.GetSpellInfo(51313)] = addon.InitEnchanting + PROFESSION_INIT_FUNCS[_G.GetSpellInfo(51306)] = addon.InitEngineering + PROFESSION_INIT_FUNCS[_G.GetSpellInfo(45542)] = addon.InitFirstAid + PROFESSION_INIT_FUNCS[_G.GetSpellInfo(51302)] = addon.InitLeatherworking + PROFESSION_INIT_FUNCS[_G.GetSpellInfo(32606)] = addon.InitSmelting + PROFESSION_INIT_FUNCS[_G.GetSpellInfo(51309)] = addon.InitTailoring + PROFESSION_INIT_FUNCS[_G.GetSpellInfo(51311)] = addon.InitJewelcrafting + PROFESSION_INIT_FUNCS[_G.GetSpellInfo(45363)] = addon.InitInscription + PROFESSION_INIT_FUNCS[private.runeforging_name] = addon.InitRuneforging ------------------------------------------------------------------------------- -- Hook GameTooltip so we can show information on mobs that drop/sell/train @@ -907,7 +907,7 @@ function addon:InitializeProfession(profession) if profession == private.professions["Smelting"] then profession = private.mining_name end - local func = private.profession_init_funcs[profession] + local func = PROFESSION_INIT_FUNCS[profession] if func then func(addon) -- 1.7.9.5