Quantcast

May as well go ahead and detect if a vendor listed as limited supply actually has an unlimited supply and fix that, too.

James D. Callahan III [03-10-11 - 11:39]
May as well go ahead and detect if a vendor listed as limited supply actually has an unlimited supply and fix that, too.
Filename
Scanner.lua
diff --git a/Scanner.lua b/Scanner.lua
index 80e90f3..e6d3fa2 100644
--- a/Scanner.lua
+++ b/Scanner.lua
@@ -1294,10 +1294,16 @@ do
 							added_output = true
 							table.insert(output, ("Vendor ID missing from \"%s\" %d."):format(recipe and recipe.name or _G.UNKNOWN, spell_id))
 						else
-							if private.vendor_list[vendor_id].item_list[spell_id] == true and supply > -1 then
+							local reported_supply = private.vendor_list[vendor_id].item_list[spell_id]
+
+							if reported_supply == true and supply > -1 then
 								recipe:AddLimitedVendor(vendor_id, supply)
 								table.insert(output, ("Limited quantity for \"%s\" (%d) found on vendor %d - listed as unlimited quantity."):format(recipe.name, spell_id, vendor_id))
 								added_output = true
+							elseif type(reported_supply) ~= "boolean" and supply == -1 then
+								recipe:AddVendor(vendor_id)
+								table.insert(output, ("Unlimited quantity for \"%s\" (%d) found on vendor %d - listed as limited quantity."):format(recipe.name, spell_id, vendor_id))
+								added_output = true
 							end

 							if not recipe:HasFilter("common1", "VENDOR") then