diff Core.lua @ 48:508110e7c8ee

Merged my fix for the changelog
author Asa Ayers <Asa.Ayers@Gmail.com>
date Tue, 20 Jul 2010 00:20:15 -0700
parents a66f6fc57cfb
children 234896be4087
line wrap: on
line diff
--- a/Core.lua	Tue Jul 20 00:18:10 2010 -0700
+++ b/Core.lua	Tue Jul 20 00:20:15 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