mirror of
https://github.com/NathanHandley/mod-ah-bot-plus.git
synced 2026-01-13 01:08:37 +00:00
fixed return of cancelled auctions to AHBot when ReturnExpiredAuctionItemsToBot is true
This commit is contained in:
@@ -1648,28 +1648,14 @@ void AuctionHouseBot::EmptyAuctionHouses()
|
|||||||
|
|
||||||
// Return item to AHBot if configured, else delete it
|
// Return item to AHBot if configured, else delete it
|
||||||
if (ReturnExpiredAuctionItemsToBot)
|
if (ReturnExpiredAuctionItemsToBot)
|
||||||
{
|
sAuctionMgr->SendAuctionExpiredMail(auction, trans, true, true);
|
||||||
// Copied logic from AuctionHouseMgr.cpp::SendAuctionExpiredMail(), but not working as intended
|
|
||||||
// For now, delete from DB so data doesn't build up unnecessarily
|
|
||||||
Item::DeleteFromDB(trans, auction->item_guid.GetCounter());
|
|
||||||
|
|
||||||
// Player* owner = ObjectAccessor::FindPlayer(auction->owner);
|
|
||||||
// Item* item = sAuctionMgr->GetAItem(auction->item_guid);
|
|
||||||
// owner->GetSession()->SendAuctionOwnerNotification(auction);
|
|
||||||
// MailDraft(auction->BuildAuctionMailSubject(AUCTION_EXPIRED), AuctionEntry::BuildAuctionMailBody(ObjectGuid::Empty, 0, auction->buyout, auction->deposit))
|
|
||||||
// .AddItem(item)
|
|
||||||
// .SendMailTo(trans, MailReceiver(owner, auction->owner.GetCounter()), auction, MAIL_CHECK_MASK_COPIED, 0);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
Item::DeleteFromDB(trans, auction->item_guid.GetCounter());
|
Item::DeleteFromDB(trans, auction->item_guid.GetCounter());
|
||||||
}
|
|
||||||
|
|
||||||
// Remove auction from AH
|
// Remove auction from AH
|
||||||
auction->DeleteFromDB(trans);
|
auction->DeleteFromDB(trans);
|
||||||
sAuctionMgr->RemoveAItem(auction->item_guid);
|
sAuctionMgr->RemoveAItem(auction->item_guid);
|
||||||
auctionHouse->RemoveAuction(auction);
|
auctionHouse->RemoveAuction(auction);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -117,9 +117,17 @@ public:
|
|||||||
}
|
}
|
||||||
if (isAHBot == true)
|
if (isAHBot == true)
|
||||||
{
|
{
|
||||||
if (sender.GetMailMessageType() == MAIL_AUCTION) // auction mail with items
|
if (sConfigMgr->GetOption<bool>("AuctionHouseBot.ReturnExpiredAuctionItemsToBot", false))
|
||||||
deleteMailItemsFromDB = true;
|
{
|
||||||
sendMail = false;
|
deleteMailItemsFromDB = false;
|
||||||
|
sendMail = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (sender.GetMailMessageType() == MAIL_AUCTION) // auction mail with items
|
||||||
|
deleteMailItemsFromDB = true;
|
||||||
|
sendMail = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user