# HG changeset patch # User Asa Ayers # Date 1279609794 25200 # Node ID a66f6fc57cfb47c8cdc20f7953d4af1414c39225 # Parent 9a6d4e2768fdd318daa852e1d98b77c6083df7aa Fixed two nil related errors and an error with calculating how much an item is worth when it is being created or destroyed. diff -r 9a6d4e2768fd -r a66f6fc57cfb CHANGELOG.txt --- a/CHANGELOG.txt Mon Jul 19 22:49:02 2010 -0700 +++ b/CHANGELOG.txt Tue Jul 20 00:09:54 2010 -0700 @@ -3,6 +3,8 @@ - Implemented COD mail (Ticket #1) and updated the way postage was counted so that if you mail multiple items at once, they will all have the postage counted. I also removed the 30c for postage from how QA thresholds are calculated now that they will be counted every time. - Added a dialog to allow the user to send COD mail without a tracking number. - Replaced my edit window with a static popup. This looks and behaves better this way. +- Fixed a couple nil related bugs +- Fixed the way prices were being calculated as items were being created/destroyed/converted/crafted 2010-07-18 Asa Ayers diff -r 9a6d4e2768fd -r a66f6fc57cfb Core.lua --- a/Core.lua Mon Jul 19 22:49:02 2010 -0700 +++ b/Core.lua Tue Jul 20 00:09:54 2010 -0700 @@ -220,10 +220,11 @@ local trackID if outboundSubject ~= nil then self:Debug(outboundSubject) - trackID = tonumber(select(3, outboundSubject:find('[[]IA: (%d*)[]]'))) + trackID = select(3, outboundSubject:find('[[]IA: (%d*)[]]')) - self:Debug('COD ID: %s', trackID) if trackID ~= nil then + trackID = tonumber(trackID) + self:Debug('COD ID: %s', trackID) local cod = self.db.factionrealm.outbound_cod[trackID] if cod == nil then skipMail[mailSignature] = true @@ -308,6 +309,10 @@ if self.items[link] ~= nil then self.items[link].count = Altoholic:GetItemCount(self:GetIDFromLink(link)) + + if self.items[link].invested == nil then + self.items[link].invested = 0 + end end if viewOnly == true and self.items[link] == nil then @@ -432,7 +437,7 @@ count = count - countModifier end if count > 0 then - return ceil(item.invested), ceil(item.invested/item.count), count + return ceil(item.invested), ceil(item.invested/count), count end end