changeset 96:e0ddd02d6555 v45

tweak to ignore some junk in team optimizer loot export
author yellowfive
date Sat, 01 Oct 2016 15:48:00 -0700
parents 975b49848703
children 2972db948c80
files AskMrRobot-Serializer/AskMrRobot-Serializer.lua AskMrRobot.toc TeamOptimizer.lua
diffstat 3 files changed, 14 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/AskMrRobot-Serializer/AskMrRobot-Serializer.lua	Fri Sep 23 18:29:56 2016 -0700
+++ b/AskMrRobot-Serializer/AskMrRobot-Serializer.lua	Sat Oct 01 15:48:00 2016 -0700
@@ -1,7 +1,7 @@
 -- AskMrRobot-Serializer will serialize and communicate character data between users.
 -- This is used primarily to associate character information to logs uploaded to askmrrobot.com.
 
-local MAJOR, MINOR = "AskMrRobot-Serializer", 44
+local MAJOR, MINOR = "AskMrRobot-Serializer", 45
 local Amr, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
 
 if not Amr then return end -- already loaded by something else
--- a/AskMrRobot.toc	Fri Sep 23 18:29:56 2016 -0700
+++ b/AskMrRobot.toc	Sat Oct 01 15:48:00 2016 -0700
@@ -1,7 +1,7 @@
 ## Interface: 70000
 ## Title: Ask Mr. Robot
 ## Author: Team Robot, Inc.
-## Version: 44
+## Version: 45
 ## Notes: Gear import/export, combat logging, and more.
 ## URL: www.askmrrobot.com
 ## SavedVariables: AskMrRobotDb3
--- a/TeamOptimizer.lua	Fri Sep 23 18:29:56 2016 -0700
+++ b/TeamOptimizer.lua	Sat Oct 01 15:48:00 2016 -0700
@@ -794,6 +794,11 @@
 	Amr.db.global.TeamOpt.LootGear = newInfo	
 end
 
+local _ignoreLoot = {
+	[139562] = true,
+	[136903] = true
+}
+
 local function scanMasterLoot()
 	-- only care if we are in a raid or group
 	if not IsInGroup() and not IsInRaid() then return end
@@ -817,7 +822,13 @@
 		local lootType = GetLootSlotType(i)
 		if lootType == 1 then
 			local link = GetLootSlotLink(i)
-			table.insert(loot, link)
+			local success, itemObj = pcall(Amr.ParseItemLink, link)
+			
+			if not success or not itemObj or _ignoreLoot[itemObj.id] then
+				-- ignore items that can't be read or that we explicitly don't care about
+			else			
+				table.insert(loot, link)
+			end
 		end
 	end