added safety check to buying by confirmation in case some other addon or something changes the page

This commit is contained in:
Manuel Simon Hirsig
2015-11-10 22:14:59 +01:00
parent d4a2822533
commit 7d271b4a1b
3 changed files with 43 additions and 37 deletions
+14 -12
View File
@@ -672,18 +672,20 @@ function find_auction(entry, buyout_mode, express_mode)
Aux.scan.abort()
else
public.dialog_action = function()
if GetMoney() >= amount then
PlaceAuctionBid('list', auction_info.index, buyout_mode and amount or MoneyInputFrame_GetCopper(AuxItemSearchFrameAuctionsConfirmationContentBid))
Aux.log((buyout_mode and 'Purchased ' or 'Bid on ')..auction_record.hyperlink..' x '..auction_record.aux_quantity..' at '..Aux.util.money_string(buyout_mode and amount or MoneyInputFrame_GetCopper(AuxItemSearchFrameAuctionsConfirmationContentBid))..'.')
entry.gone = true
refresh = true
else
Aux.log('Not enough money.')
end
Aux.scan.abort()
AuxItemSearchFrameItemRefreshButton:Enable()
AuxItemSearchFrameAuctionsConfirmation:Hide()
update_listing()
if create_auction_record(Aux.info.auction(auction_info.index)).signature == entry.signature then
if GetMoney() >= amount then
PlaceAuctionBid('list', auction_info.index, buyout_mode and amount or MoneyInputFrame_GetCopper(AuxItemSearchFrameAuctionsConfirmationContentBid))
Aux.log((buyout_mode and 'Purchased ' or 'Bid on ')..auction_record.hyperlink..' x '..auction_record.aux_quantity..' at '..Aux.util.money_string(buyout_mode and amount or MoneyInputFrame_GetCopper(AuxItemSearchFrameAuctionsConfirmationContentBid))..'.')
entry.gone = true
refresh = true
else
Aux.log('Not enough money.')
end
Aux.scan.abort()
AuxItemSearchFrameItemRefreshButton:Enable()
AuxItemSearchFrameAuctionsConfirmation:Hide()
update_listing()
end
end
AuxItemSearchFrameAuctionsConfirmationContentActionButton:Enable()
end