# HG changeset patch # User Asa Ayers # Date 1279769816 25200 # Node ID 9c95158236d19d1650ff175c3f4c1c066aa22110 # Parent 84bfb54691891a5d8d60f32787023b554d25cfab Fixed the way I was calculating the value when distributing cost among multiple items. diff -r 84bfb5469189 -r 9c95158236d1 Modules/Events.lua --- a/Modules/Events.lua Wed Jul 21 01:22:30 2010 -0700 +++ b/Modules/Events.lua Wed Jul 21 20:36:56 2010 -0700 @@ -235,15 +235,14 @@ The only time I know that this is a problem is when crafting a BOP item, and it is always crafted 1 at a time, so a weight of 1 will work. ]] - local ap = (addon:GetAuctionPrice(link) or 1) + local ap = (addon:GetAuctionPrice(link) or 1) * change totalWeight = totalWeight + ap weights[link] = ap end - local valuePerPoint = totalValue / totalWeight - for link, change in pairs(targetItems) do - self:SaveValue(link, weights[link] * valuePerPoint, change) + local value = totalValue * (weights[link]/totalWeight) + self:SaveValue(link, value, change) end end