From 7db6a64e96829c17370d7937674d932c9437d19e Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Fri, 11 Sep 2015 00:10:19 +0200 Subject: [PATCH] bugfix --- buy.lua | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/buy.lua b/buy.lua index 0e1f5f2..060ee6c 100644 --- a/buy.lua +++ b/buy.lua @@ -55,25 +55,27 @@ function AuxBuyBuySelectedButton_OnClick() Aux_Scan_Start{ query = searchQuery, onReadDatum = function(datum) - local key = datum.name.."_"..datum.stackSize.."_"..datum.buyoutPrice - if order[key] then - - if GetMoney() >= datum.buyoutPrice then - PlaceAuctionBid("list", datum.pageIndex, datum.buyoutPrice) - purchasedCount = purchasedCount + 1 - else + if datum.name and datum.count and datum.buyoutPrice then + local key = datum.name.."_"..datum.count.."_"..datum.buyoutPrice + if order[key] then + + if GetMoney() >= datum.buyoutPrice then + PlaceAuctionBid("list", datum.pageIndex, datum.buyoutPrice) + purchasedCount = purchasedCount + 1 + else + + end - end - - if order[key] > 1 then - order[key] = order[key] - 1 + if order[key] > 1 then + order[key] = order[key] - 1 + else + order[key] = nil + end + + return false else - order[key] = nil + return true end - - return false - else - return true end end, onComplete = function(data)