comparison Modules/Crafting.lua @ 116:44be3f350c9e

Fixed a bug introduced in r110 (2010-08-30) where the price an item should sell for was not being calculated.
author Asa Ayers <Asa.Ayers@Gmail.com>
date Thu, 02 Sep 2010 11:45:47 -0700
parents cf160210433c
children d4cb8a690335
comparison
equal deleted inserted replaced
110:cf160210433c 116:44be3f350c9e
433 need = 0, -- This will get populated after the decisions have been made. it can't 433 need = 0, -- This will get populated after the decisions have been made. it can't
434 -- be done before that because highest profit items get priority on materials. 434 -- be done before that because highest profit items get priority on materials.
435 } 435 }
436 totalCost = totalCost + reagentTotalCost 436 totalCost = totalCost + reagentTotalCost
437 end 437 end
438
439 local price = (self:GetAuctionPrice(itemLink) or 0)
440 totalCost = totalCost + (price * ItemAuditor:GetAHCut())
438 local data = { 441 local data = {
439 recipeLink = recipeLink, 442 recipeLink = recipeLink,
440 recipeID = Utils.GetItemID(recipeLink), 443 recipeID = Utils.GetItemID(recipeLink),
441 link = itemLink, 444 link = itemLink,
442 name = itemName, 445 name = itemName,
457 but this should not go below 0 460 but this should not go below 0
458 ]] 461 ]]
459 if data.queue > 0 then 462 if data.queue > 0 then
460 data.queue = max(0, data.queue - count) 463 data.queue = max(0, data.queue - count)
461 end 464 end
462
463 local price = (self:GetAuctionPrice(itemLink) or 0)
464 totalCost = totalCost + (price * ItemAuditor:GetAHCut())
465 465
466 -- If a tradeskill makes 5 at a time and something asks for 9, we should only 466 -- If a tradeskill makes 5 at a time and something asks for 9, we should only
467 -- craft twice to get 10. 467 -- craft twice to get 10.
468 data.queue = ceil(data.queue / GetTradeSkillNumMade(i)) 468 data.queue = ceil(data.queue / GetTradeSkillNumMade(i))
469 469