Core/AuctionHouse: Skip own account commodity listing when buying
Port From (https://github.com/TrinityCore/TrinityCore/commit/8ff8dfd6207561f66b9c30cf0153f400d4a11ba9)
This commit is contained in:
@@ -1140,6 +1140,9 @@ namespace Game
|
|||||||
uint remainingQuantity = quantity;
|
uint remainingQuantity = quantity;
|
||||||
foreach (AuctionPosting auction in bucketData.Auctions)
|
foreach (AuctionPosting auction in bucketData.Auctions)
|
||||||
{
|
{
|
||||||
|
if (auction.Owner == player.GetGUID() || auction.OwnerAccount == player.GetSession().GetAccountGUID())
|
||||||
|
continue;
|
||||||
|
|
||||||
foreach (Item auctionItem in auction.Items)
|
foreach (Item auctionItem in auction.Items)
|
||||||
{
|
{
|
||||||
if (auctionItem.GetCount() >= remainingQuantity)
|
if (auctionItem.GetCount() >= remainingQuantity)
|
||||||
@@ -1199,6 +1202,9 @@ namespace Game
|
|||||||
for (var i = 0; i < bucketItr.Auctions.Count;)
|
for (var i = 0; i < bucketItr.Auctions.Count;)
|
||||||
{
|
{
|
||||||
AuctionPosting auction = bucketItr.Auctions[i++];
|
AuctionPosting auction = bucketItr.Auctions[i++];
|
||||||
|
if (auction.Owner == player.GetGUID() || auction.OwnerAccount == player.GetSession().GetAccountGUID())
|
||||||
|
continue;
|
||||||
|
|
||||||
auctions.Add(auction);
|
auctions.Add(auction);
|
||||||
foreach (Item auctionItem in auction.Items)
|
foreach (Item auctionItem in auction.Items)
|
||||||
{
|
{
|
||||||
@@ -1239,8 +1245,7 @@ namespace Game
|
|||||||
ObjectGuid? uniqueSeller = new();
|
ObjectGuid? uniqueSeller = new();
|
||||||
|
|
||||||
// prepare items
|
// prepare items
|
||||||
List<MailedItemsBatch> items = new();
|
List<MailedItemsBatch> items = [new MailedItemsBatch()];
|
||||||
items.Add(new MailedItemsBatch());
|
|
||||||
|
|
||||||
remainingQuantity = quantity;
|
remainingQuantity = quantity;
|
||||||
List<int> removedItemsFromAuction = new();
|
List<int> removedItemsFromAuction = new();
|
||||||
@@ -1248,6 +1253,9 @@ namespace Game
|
|||||||
for (var i = 0; i < bucketItr.Auctions.Count;)
|
for (var i = 0; i < bucketItr.Auctions.Count;)
|
||||||
{
|
{
|
||||||
AuctionPosting auction = bucketItr.Auctions[i++];
|
AuctionPosting auction = bucketItr.Auctions[i++];
|
||||||
|
if (auction.Owner == player.GetGUID() || auction.OwnerAccount == player.GetSession().GetAccountGUID())
|
||||||
|
continue;
|
||||||
|
|
||||||
if (!uniqueSeller.HasValue)
|
if (!uniqueSeller.HasValue)
|
||||||
uniqueSeller = auction.Owner;
|
uniqueSeller = auction.Owner;
|
||||||
else if (uniqueSeller != auction.Owner)
|
else if (uniqueSeller != auction.Owner)
|
||||||
|
|||||||
Reference in New Issue
Block a user