changeset 157:091bae7bfca0

Fixed a bug in calculating purchase/sale where the item ID was being used instead of the number of items that changed.
author Asa Ayers <Asa.Ayers@Gmail.com>
date Wed, 15 Dec 2010 22:49:28 -0800
parents d108b0112be3
children 7ebe0a85d539
files CHANGELOG.txt Modules/Events.lua
diffstat 2 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGELOG.txt	Fri Dec 10 00:48:20 2010 -0800
+++ b/CHANGELOG.txt	Wed Dec 15 22:49:28 2010 -0800
@@ -1,3 +1,7 @@
+2011-01-09  Asa Ayers  <Asa.Ayers@Gmail.com>
+
+- Fixed a bug in calculating purchase/sale where the item ID was being used instead of the number of items that changed.
+
 2010-12-10  Asa Ayers  <Asa.Ayers@Gmail.com>
 
 - I removed all of the vellums that were removed from the game. This also allowed me to make the one remaining vellum count toward the materials required to craft a scroll.
--- a/Modules/Events.lua	Fri Dec 10 00:48:20 2010 -0800
+++ b/Modules/Events.lua	Wed Dec 15 22:49:28 2010 -0800
@@ -400,7 +400,7 @@
 		self:Debug("purchase or sale")
 		
 		for itemID, count in pairs(diff.items) do
-			self:SaveValue(itemID, 0 - diff.money, itemID)
+			self:SaveValue(itemID, 0 - diff.money, count)
 		end
 	elseif self:tcount(diff.items) > 1 and self:tcount(positive) > 0 and self:tcount(negative) > 0 then
 		-- we must have created/converted something