Mercurial > wow > itemauditor
diff Core.lua @ 158:7ebe0a85d539
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.
author | Asa Ayers <Asa.Ayers@Gmail.com> |
---|---|
date | Wed, 15 Dec 2010 23:15:17 -0800 |
parents | cbb427a8d5a5 |
children | fbfd9dfa6d2b |
line wrap: on
line diff
--- 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)