# HG changeset patch # User Asa Ayers # Date 1292483717 28800 # Node ID 7ebe0a85d5391e4a8324a6ef04be5e98f8039dce # Parent 091bae7bfca0f8b4519891c9de3c12b4e87279e7 Fixed the way ItemLinks are extracted so that ItemAuditor can handle negative UniqeIDs. I had two of the same item, but one had a negative unique id and was being tracked as if it were a different item. diff -r 091bae7bfca0 -r 7ebe0a85d539 CHANGELOG.txt --- a/CHANGELOG.txt Wed Dec 15 22:49:28 2010 -0800 +++ b/CHANGELOG.txt Wed Dec 15 23:15:17 2010 -0800 @@ -1,6 +1,7 @@ 2011-01-09 Asa Ayers - Fixed a bug in calculating purchase/sale where the item ID was being used instead of the number of items that changed. +- Fixed the way ItemLinks are extracted so that ItemAuditor can handle negative UniqeIDs. I had two of the same item, but one had a negative unique id and was being tracked as if it were a different item. 2010-12-10 Asa Ayers diff -r 091bae7bfca0 -r 7ebe0a85d539 Core.lua --- a/Core.lua Wed Dec 15 22:49:28 2010 -0800 +++ b/Core.lua Wed Dec 15 23:15:17 2010 -0800 @@ -602,10 +602,10 @@ function ItemAuditor:GetSafeLink(link) local newLink = nil - if link and link == string.match(link, '.-:[-0-9]+[:0-9]*') then + if link and link == string.match(link, '.-:[-0-9]+[-:0-9]*') then newLink = link elseif link then - newLink = link and string.match(link, "|H(.-):([-0-9]+):([0-9]+)|h") + newLink = link and string.match(link, "|H(.-):([-0-9]+):([-0-9]+)|h") end if newLink == nil then local itemID = self:GetItemID(link) @@ -614,7 +614,7 @@ return self:GetSafeLink(newLink) end end - return newLink and string.gsub(newLink, ":0:0:0:0:0:0:[0-9]+", "") + return newLink and string.gsub(newLink, ":0:0:0:0:0:0:[-0-9]+", "") end function ItemAuditor:GetIDFromLink(link)