Quantcast

In addon:AddLookupList(): Check whether or not DB[ID] exists already: If so, warn alpha testers and return.

torhal [06-10-09 - 00:32]
In addon:AddLookupList(): Check whether or not DB[ID] exists already: If so, warn alpha testers and return.
Filename
AckisRecipeList.lua
diff --git a/AckisRecipeList.lua b/AckisRecipeList.lua
index 0935285..bc8104d 100644
--- a/AckisRecipeList.lua
+++ b/AckisRecipeList.lua
@@ -715,9 +715,16 @@ function addon:addLookupList(DB, ID, Name, Loc, Coordx, Coordy, Faction)
 		For individual database structures, see Documentation.lua
 	]]--

-	DB[ID] = {}
-	DB[ID]["Name"] = Name
+	--@alpha@
+	if DB[ID] then
+		self:Print("Duplicate lookup: "..tostring(ID).." "..Name)
+		return
+	end
+	--@end-alpha@

+	DB[ID] = {
+		["Name"] = Name
+	}
 	if (Loc) then
 		DB[ID]["Location"] = Loc
 	else