Quantcast

The return value for addon:InitializeProfession() was never used. Anywhere. Ever. Removed.

James D. Callahan III [03-08-11 - 04:24]
The return value for addon:InitializeProfession() was never used. Anywhere. Ever. Removed.
Filename
Database/Alchemy.lua
Database/Blacksmithing.lua
Database/Cooking.lua
Database/Enchanting.lua
Database/Engineering.lua
Database/FirstAid.lua
Database/Inscription.lua
Database/Jewelcrafting.lua
Database/Leatherworking.lua
Database/Runeforging.lua
Database/Smelting.lua
Database/Tailoring.lua
core.lua
diff --git a/Database/Alchemy.lua b/Database/Alchemy.lua
index 0baa311..cab4a7d 100644
--- a/Database/Alchemy.lua
+++ b/Database/Alchemy.lua
@@ -32,23 +32,14 @@ local REP = private.rep_levels
 local FAC = private.faction_ids
 local V = private.game_versions

-local initialized = false
-local num_recipes = 0
-
 --------------------------------------------------------------------------------------------------------------------
 -- Counter and wrapper function
 --------------------------------------------------------------------------------------------------------------------
 local function AddRecipe(spell_id, skill_level, item_id, quality, genesis, optimal_level, medium_level, easy_level, trivial_level)
-	num_recipes = num_recipes + 1
 	return addon:AddRecipe(spell_id, skill_level, item_id, quality, 51304, nil, genesis, optimal_level, medium_level, easy_level, trivial_level)
 end

 function addon:InitAlchemy()
-	if initialized then
-		return num_recipes
-	end
-	initialized = true
-
 	local recipe

 	-- Elixir of Lion's Strength -- 2329
@@ -1546,5 +1537,5 @@ function addon:InitAlchemy()
 	recipe:AddFilters(F.ALLIANCE, F.HORDE, F.TRAINER, F.IBOP, F.RBOP)
 	recipe:AddTrainer(1386, 2132, 3009, 3184, 3347, 4160, 4611, 5177, 5499, 26951, 26975, 27023, 27029, 28703, 33588)

-	return num_recipes
+	self.InitAlchemy = nil
 end
diff --git a/Database/Blacksmithing.lua b/Database/Blacksmithing.lua
index 1a82057..0893eb8 100644
--- a/Database/Blacksmithing.lua
+++ b/Database/Blacksmithing.lua
@@ -32,23 +32,14 @@ local REP	= private.rep_levels
 local FAC	= private.faction_ids
 local V		= private.game_versions

-local initialized = false
-local num_recipes = 0
-
 --------------------------------------------------------------------------------------------------------------------
 -- Counter and wrapper function
 --------------------------------------------------------------------------------------------------------------------
 local function AddRecipe(spell_id, skill_level, item_id, quality, genesis, optimal_level, medium_level, easy_level, trivial_level, specialty)
-	num_recipes = num_recipes + 1
 	return addon:AddRecipe(spell_id, skill_level, item_id, quality, 2018, specialty, genesis, optimal_level, medium_level, easy_level, trivial_level)
 end

-function addon:InitBlacksmithing()
-	if initialized then
-		return num_recipes
-	end
-	initialized = true
-
+function addon:InitBlacksmithing()
 	local recipe

 	-- Rough Sharpening Stone -- 2660
@@ -2932,7 +2923,5 @@ function addon:InitBlacksmithing()
 	recipe:AddFilters(F.ALLIANCE, F.HORDE, F.VENDOR, F.IBOE, F.RBOP)
 	recipe:AddVendor(50375, 50382)

-
-	return num_recipes
-
+	self.InitBlacksmithing = nil
 end
diff --git a/Database/Cooking.lua b/Database/Cooking.lua
index 6d93bbd..810c6bd 100644
--- a/Database/Cooking.lua
+++ b/Database/Cooking.lua
@@ -32,23 +32,14 @@ local REP = private.rep_levels
 local FAC = private.faction_ids
 local V = private.game_versions

-local initialized = false
-local num_recipes = 0
-
 --------------------------------------------------------------------------------------------------------------------
 -- Counter and wrapper function
 --------------------------------------------------------------------------------------------------------------------
 local function AddRecipe(spell_id, skill_level, item_id, quality, genesis, optimal_level, medium_level, easy_level, trivial_level)
-	num_recipes = num_recipes + 1
 	return addon:AddRecipe(spell_id, skill_level, item_id, quality, 2550, nil, genesis, optimal_level, medium_level, easy_level, trivial_level)
 end

 function addon:InitCooking()
-	if initialized then
-		return num_recipes
-	end
-	initialized = true
-
 	local recipe

 	-- Charred Wolf Meat -- 2538
@@ -1155,6 +1146,6 @@ function addon:InitCooking()

 	end

-	return num_recipes

-end
\ No newline at end of file
+	self.InitCooking = nil
+end
diff --git a/Database/Enchanting.lua b/Database/Enchanting.lua
index 350247c..2d855bd 100644
--- a/Database/Enchanting.lua
+++ b/Database/Enchanting.lua
@@ -32,23 +32,14 @@ local REP = private.rep_levels
 local FAC = private.faction_ids
 local V = private.game_versions

-local initialized = false
-local num_recipes = 0
-
 --------------------------------------------------------------------------------------------------------------------
 -- Counter and wrapper function
 --------------------------------------------------------------------------------------------------------------------
 local function AddRecipe(spell_id, skill_level, item_id, quality, genesis, optimal_level, medium_level, easy_level, trivial_level)
-	num_recipes = num_recipes + 1
 	return addon:AddRecipe(spell_id, skill_level, item_id, quality, 7411, nil, genesis, optimal_level, medium_level, easy_level, trivial_level)
 end

 function addon:InitEnchanting()
-	if initialized then
-		return num_recipes
-	end
-	initialized = true
-
 	local recipe

 	-- Enchant Bracer - Minor Health -- 7418
@@ -1816,5 +1807,5 @@ function addon:InitEnchanting()
 	recipe:AddFilters(F.ALLIANCE, F.HORDE, F.WORLD_DROP, F.IBOE, F.RBOE)
 	recipe:AddWorldDrop("Deepholm", "Eastern Kingdoms", "Kalimdor")

-	return num_recipes
+	self.InitEnchanting = nil
 end
diff --git a/Database/Engineering.lua b/Database/Engineering.lua
index a16bf0f..24ce479 100644
--- a/Database/Engineering.lua
+++ b/Database/Engineering.lua
@@ -33,23 +33,14 @@ local REP	= private.rep_levels
 local FAC	= private.faction_ids
 local V		= private.game_versions

-local initialized = false
-local num_recipes = 0
-
 --------------------------------------------------------------------------------------------------------------------
 -- Counter and wrapper function
 --------------------------------------------------------------------------------------------------------------------
 local function AddRecipe(spell_id, skill_level, item_id, quality, genesis, optimal_level, medium_level, easy_level, trivial_level, specialty)
-	num_recipes = num_recipes + 1
 	return addon:AddRecipe(spell_id, skill_level, item_id, quality, 4036, specialty, genesis, optimal_level, medium_level, easy_level, trivial_level)
 end

 function addon:InitEngineering()
-	if initialized then
-		return num_recipes
-	end
-	initialized = true
-
 	local recipe

 	-- Rough Blasting Powder -- 3918
@@ -1666,5 +1657,5 @@ function addon:InitEngineering()
 	recipe:AddFilters(F.ALLIANCE, F.HORDE, F.TRAINER, F.IBOE, F.RBOP)
 	recipe:AddTrainer(5518, 11017)

-	return num_recipes
+	self.InitEngineering = nil
 end
diff --git a/Database/FirstAid.lua b/Database/FirstAid.lua
index e0467be..ef9d120 100644
--- a/Database/FirstAid.lua
+++ b/Database/FirstAid.lua
@@ -32,23 +32,14 @@ local REP = private.rep_levels
 local FAC = private.faction_ids
 local V = private.game_versions

-local initialized = false
-local num_recipes = 0
-
 --------------------------------------------------------------------------------------------------------------------
 -- Counter and wrapper function
 --------------------------------------------------------------------------------------------------------------------
 local function AddRecipe(spell_id, skill_level, item_id, quality, genesis, optimal_level, medium_level, easy_level, trivial_level)
-	num_recipes = num_recipes + 1
 	return addon:AddRecipe(spell_id, skill_level, item_id, quality, 3273, nil, genesis, optimal_level, medium_level, easy_level, trivial_level)
 end

 function addon:InitFirstAid()
-	if initialized then
-		return num_recipes
-	end
-	initialized = true
-
 	local recipe

 	-- Linen Bandage -- 3275
@@ -157,5 +148,5 @@ function addon:InitFirstAid()
 	recipe:AddFilters(F.ALLIANCE, F.HORDE, F.TRAINER, F.IBOE, F.RBOP)
 	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)

-	return num_recipes
+	self.InitFirstAid = nil
 end
diff --git a/Database/Inscription.lua b/Database/Inscription.lua
index 80293ce..2314057 100644
--- a/Database/Inscription.lua
+++ b/Database/Inscription.lua
@@ -35,23 +35,14 @@ local REP = private.rep_levels
 local FAC = private.faction_ids
 local V = private.game_versions

-local initialized = false
-local num_recipes = 0
-
 --------------------------------------------------------------------------------------------------------------------
 -- Counter and wrapper function
 --------------------------------------------------------------------------------------------------------------------
 local function AddRecipe(spell_id, skill_level, item_id, quality, genesis, optimal_level, medium_level, easy_level, trivial_level)
-	num_recipes = num_recipes + 1
 	return addon:AddRecipe(spell_id, skill_level, item_id, quality, 45357, nil, genesis, optimal_level, medium_level, easy_level, trivial_level)
 end

 function addon:InitInscription()
-	if initialized then
-		return num_recipes
-	end
-	initialized = true
-
 	local recipe

 	-- Scroll of Stamina -- 45382
@@ -2383,5 +2374,5 @@ function addon:InitInscription()
 	recipe:AddFilters(F.ALLIANCE, F.HORDE, F.TRAINER, F.IBOE, F.RBOE)
 	recipe:AddTrainer(28702, 30706, 30711, 30713, 30715, 30717, 46716)

-	return num_recipes
+	self.InitInscription = nil
 end
diff --git a/Database/Jewelcrafting.lua b/Database/Jewelcrafting.lua
index 68801bb..ef5013f 100644
--- a/Database/Jewelcrafting.lua
+++ b/Database/Jewelcrafting.lua
@@ -32,23 +32,14 @@ local REP = private.rep_levels
 local FAC = private.faction_ids
 local V = private.game_versions

-local initialized = false
-local num_recipes = 0
-
 --------------------------------------------------------------------------------------------------------------------
 -- Counter and wrapper function
 --------------------------------------------------------------------------------------------------------------------
 local function AddRecipe(spell_id, skill_level, item_id, quality, genesis, optimal_level, medium_level, easy_level, trivial_level)
-	num_recipes = num_recipes + 1
 	return addon:AddRecipe(spell_id, skill_level, item_id, quality, 25229, nil, genesis, optimal_level, medium_level, easy_level, trivial_level)
 end

 function addon:InitJewelcrafting()
-	if initialized then
-		return num_recipes
-	end
-	initialized = true
-
 	local recipe

 	-- Delicate Copper Wire -- 25255
@@ -3018,5 +3009,5 @@ function addon:InitJewelcrafting()
 	recipe:AddFilters(F.ALLIANCE, F.HORDE, F.WORLD_DROP, F.IBOE, F.RBOE)
 	recipe:AddWorldDrop("Deepholm", "Eastern Kingdoms", "Kalimdor")

-	return num_recipes
+	self.InitJewelcrafting = nil
 end
diff --git a/Database/Leatherworking.lua b/Database/Leatherworking.lua
index 6b40cc3..425e956 100644
--- a/Database/Leatherworking.lua
+++ b/Database/Leatherworking.lua
@@ -12,44 +12,35 @@ Please see http://www.wowace.com/addons/arl/ for more information.
 ************************************************************************
 This source code is released under All Rights Reserved.
 ************************************************************************
-]]--
+]] --

 -------------------------------------------------------------------------------
 -- AddOn namespace.
 -------------------------------------------------------------------------------
-local MODNAME	= "Ackis Recipe List"
-local addon	= LibStub("AceAddon-3.0"):GetAddon(MODNAME)
-local L		= LibStub("AceLocale-3.0"):GetLocale(MODNAME)
+local MODNAME = "Ackis Recipe List"
+local addon = LibStub("AceAddon-3.0"):GetAddon(MODNAME)
+local L = LibStub("AceLocale-3.0"):GetLocale(MODNAME)

 local FOLDER_NAME, private = ...

 -------------------------------------------------------------------------------
 -- Filter flags. Acquire types, and Reputation levels.
 -------------------------------------------------------------------------------
-local F		= private.filter_flags
-local A		= private.acquire_types
-local Q		= private.item_qualities
-local REP	= private.rep_levels
-local FAC	= private.faction_ids
-local V		= private.game_versions
-
-local initialized = false
-local num_recipes = 0
+local F = private.filter_flags
+local A = private.acquire_types
+local Q = private.item_qualities
+local REP = private.rep_levels
+local FAC = private.faction_ids
+local V = private.game_versions

 --------------------------------------------------------------------------------------------------------------------
 -- Counter and wrapper function
 --------------------------------------------------------------------------------------------------------------------
 local function AddRecipe(spell_id, skill_level, item_id, quality, genesis, optimal_level, medium_level, easy_level, trivial_level, specialty)
-	num_recipes = num_recipes + 1
 	return addon:AddRecipe(spell_id, skill_level, item_id, quality, 2108, specialty, genesis, optimal_level, medium_level, easy_level, trivial_level)
 end

 function addon:InitLeatherworking()
-	if initialized then
-		return num_recipes
-	end
-	initialized = true
-
 	local recipe

 	-- Handstitched Leather Boots -- 2149
@@ -3071,5 +3062,6 @@ function addon:InitLeatherworking()
 	recipe:AddFilters(F.ALLIANCE, F.HORDE, F.TRAINER, F.IBOE, F.RBOP)
 	recipe:AddTrainer(3007, 3365, 3967, 4212, 4588, 5127, 5564, 26998, 28700, 29507, 33581)

-	return num_recipes
+	self.InitLeatherworking = nil
 end
+
diff --git a/Database/Runeforging.lua b/Database/Runeforging.lua
index 739eaa2..afa8087 100644
--- a/Database/Runeforging.lua
+++ b/Database/Runeforging.lua
@@ -12,42 +12,33 @@ Please see http://www.wowace.com/addons/arl/ for more information.
 ************************************************************************
 This source code is released under All Rights Reserved.
 ************************************************************************
-]]--
+]] --

 -------------------------------------------------------------------------------
 -- AddOn namespace.
 -------------------------------------------------------------------------------
-local MODNAME	= "Ackis Recipe List"
-local addon	= LibStub("AceAddon-3.0"):GetAddon(MODNAME)
-local L		= LibStub("AceLocale-3.0"):GetLocale(MODNAME)
+local MODNAME = "Ackis Recipe List"
+local addon = LibStub("AceAddon-3.0"):GetAddon(MODNAME)
+local L = LibStub("AceLocale-3.0"):GetLocale(MODNAME)

 local FOLDER_NAME, private = ...

 -------------------------------------------------------------------------------
 -- Filter flags. Acquire types, and Reputation levels.
 -------------------------------------------------------------------------------
-local F		= private.filter_flags
-local A		= private.acquire_types
-local Q		= private.item_qualities
-local V		= private.game_versions
-
-local initialized = false
-local num_recipes = 0
+local F = private.filter_flags
+local A = private.acquire_types
+local Q = private.item_qualities
+local V = private.game_versions

 --------------------------------------------------------------------------------------------------------------------
 -- Counter and wrapper function
 --------------------------------------------------------------------------------------------------------------------
 local function AddRecipe(spell_id)
-	num_recipes = num_recipes + 1
 	return addon:AddRecipe(spell_id, 1, nil, Q.COMMON, 53428, nil, V.WOTLK, 1, 1, 1, 1)
 end

 function addon:InitRuneforging()
-	if initialized then
-		return num_recipes
-	end
-	initialized = true
-
 	local recipe

 	-- Rune of Swordshattering -- 53323
@@ -100,5 +91,5 @@ function addon:InitRuneforging()
 	recipe:AddFilters(F.ALLIANCE, F.HORDE, F.TRAINER, F.IBOP, F.RBOP, F.DK, F.TWO_HAND)
 	recipe:AddTrainer(29194, 29195, 29196, 31084)

-	return num_recipes
+	self.InitRuneforging = nil
 end
diff --git a/Database/Smelting.lua b/Database/Smelting.lua
index 4da35ce..73e1080 100644
--- a/Database/Smelting.lua
+++ b/Database/Smelting.lua
@@ -30,23 +30,14 @@ local A = private.acquire_types
 local Q = private.item_qualities
 local V = private.game_versions

-local initialized = false
-local num_recipes = 0
-
 --------------------------------------------------------------------------------------------------------------------
 -- Counter and wrapper function
 --------------------------------------------------------------------------------------------------------------------
 local function AddRecipe(spell_id, skill_level, item_id, quality, genesis, optimal_level, medium_level, easy_level, trivial_level)
-	num_recipes = num_recipes + 1
 	return addon:AddRecipe(spell_id, skill_level, item_id, quality, 32606, nil, genesis, optimal_level, medium_level, easy_level, trivial_level)
 end

 function addon:InitSmelting()
-	if initialized then
-		return num_recipes
-	end
-	initialized = true
-
 	local recipe

 	-- Smelt Copper -- 2657
@@ -199,5 +190,5 @@ function addon:InitSmelting()
 	recipe:AddFilters(F.ALLIANCE, F.HORDE, F.TRAINER, F.IBOE, F.RBOP)
 	recipe:AddTrainer(3357, 4254, 5513, 16663)

-	return num_recipes
+	self.InitSmelting = nil
 end
diff --git a/Database/Tailoring.lua b/Database/Tailoring.lua
index e5974e5..9b1d44e 100644
--- a/Database/Tailoring.lua
+++ b/Database/Tailoring.lua
@@ -32,23 +32,14 @@ local REP = private.rep_levels
 local FAC = private.faction_ids
 local V = private.game_versions

-local initialized = false
-local num_recipes = 0
-
 --------------------------------------------------------------------------------------------------------------------
 -- Counter and wrapper function
 --------------------------------------------------------------------------------------------------------------------
 local function AddRecipe(spell_id, skill_level, item_id, quality, genesis, optimal_level, medium_level, easy_level, trivial_level, specialty)
-	num_recipes = num_recipes + 1
 	return addon:AddRecipe(spell_id, skill_level, item_id, quality, 3908, specialty, genesis, optimal_level, medium_level, easy_level, trivial_level)
 end

 function addon:InitTailoring()
-	if initialized then
-		return num_recipes
-	end
-	initialized = true
-
 	local recipe

 	-- Brown Linen Vest -- 2385
@@ -2424,5 +2415,5 @@ function addon:InitTailoring()
 	recipe:AddFilters(F.ALLIANCE, F.HORDE, F.TRAINER, F.IBOE, F.RBOP)
 	recipe:AddTrainer(1346, 3363, 4159, 4576, 5153, 9584, 16640, 28699, 33613, 44783, 45559)

-	return num_recipes
+	self.InitTailoring = nil
 end
diff --git a/core.lua b/core.lua
index 3ea59b2..b61ce53 100644
--- a/core.lua
+++ b/core.lua
@@ -907,10 +907,7 @@ function addon:InitializeProfession(profession)
 	local func = PROFESSION_INIT_FUNCS[profession]

 	if func then
-		return func(addon)
-	else
-		addon:Print(L["UnknownTradeSkill"]:format(profession))
-		return 0
+		func(addon)
 	end
 end

@@ -1057,9 +1054,7 @@ do
 		if self.InitializeLookups then
 			self:InitializeLookups()
 		end
-		-- Add the recipes to the database
-		-- TODO: Figure out what this variable was supposed to be for - it isn't used anywhere. -Torhal
-		player.totalRecipes = addon:InitializeProfession(current_prof)
+		addon:InitializeProfession(current_prof)

 		-------------------------------------------------------------------------------
 		-- Scan all recipes and mark the ones we know