comparison Modules/Events.lua @ 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 47885ba83d38
children
comparison
equal deleted inserted replaced
156:d108b0112be3 157:091bae7bfca0
398 self:Debug("loot") 398 self:Debug("loot")
399 elseif abs(diff.money) > 0 and self:tcount(diff.items) == 1 and not self.mailOpen then 399 elseif abs(diff.money) > 0 and self:tcount(diff.items) == 1 and not self.mailOpen then
400 self:Debug("purchase or sale") 400 self:Debug("purchase or sale")
401 401
402 for itemID, count in pairs(diff.items) do 402 for itemID, count in pairs(diff.items) do
403 self:SaveValue(itemID, 0 - diff.money, itemID) 403 self:SaveValue(itemID, 0 - diff.money, count)
404 end 404 end
405 elseif self:tcount(diff.items) > 1 and self:tcount(positive) > 0 and self:tcount(negative) > 0 then 405 elseif self:tcount(diff.items) > 1 and self:tcount(positive) > 0 and self:tcount(negative) > 0 then
406 -- we must have created/converted something 406 -- we must have created/converted something
407 self:Debug("conversion") 407 self:Debug("conversion")
408 408