Skip to content

Commit

Permalink
Add compatibility with AH threading PR request (azerothcore#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
Takenbacon authored Dec 18, 2024
1 parent eea2e77 commit b4e1653
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/AuctionHouseBot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ void AuctionHouseBot::Sell(Player* AHBplayer, AHBConfig* config)
// Retrieve the auction house situation
//

AuctionHouseEntry const* ahEntry = sAuctionMgr->GetAuctionHouseEntry(config->GetAHFID());
AuctionHouseEntry const* ahEntry = sAuctionMgr->GetAuctionHouseEntryFromFactionTemplate(config->GetAHFID());

if (!ahEntry)
{
Expand Down Expand Up @@ -915,7 +915,7 @@ void AuctionHouseBot::Sell(Player* AHBplayer, AHBConfig* config)

AuctionEntry* auctionEntry = new AuctionEntry();
auctionEntry->Id = sObjectMgr->GenerateAuctionID();
auctionEntry->houseId = config->GetAHID();
auctionEntry->houseId = AuctionHouseId(config->GetAHID());
auctionEntry->item_guid = item->GetGUID();
auctionEntry->item_template = item->GetEntry();
auctionEntry->itemCount = item->GetCount();
Expand Down
26 changes: 13 additions & 13 deletions src/AuctionHouseBotAuctionHouseScript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void AHBot_AuctionHouseScript::OnBeforeAuctionHouseMgrSendAuctionOutbiddedMail(
std::advance(it, randBot);

oldBidder->GetSession()->SendAuctionBidderNotification(
auction->GetHouseId(),
(uint32)auction->GetHouseId(),
auction->Id,
ObjectGuid::Create<HighGuid::Player>(*it),
newPrice,
Expand All @@ -84,16 +84,16 @@ void AHBot_AuctionHouseScript::OnAuctionAdd(AuctionHouseObject* /*ah*/, AuctionE
// The the configuration for the auction house
//

AuctionHouseEntry const* ahEntry = sAuctionHouseStore.LookupEntry(auction->GetHouseId());
AuctionHouseEntry const* ahEntry = sAuctionMgr->GetAuctionHouseEntryFromHouse(auction->GetHouseId());
AHBConfig* config = gNeutralConfig;

if (ahEntry)
{
if (ahEntry->houseId == AUCTIONHOUSE_ALLIANCE)
if (AuctionHouseId(ahEntry->houseId) == AuctionHouseId::Alliance)
{
config = gAllianceConfig;
}
else if (ahEntry->houseId == AUCTIONHOUSE_HORDE)
else if (AuctionHouseId(ahEntry->houseId) == AuctionHouseId::Horde)
{
config = gHordeConfig;
}
Expand Down Expand Up @@ -147,16 +147,16 @@ void AHBot_AuctionHouseScript::OnAuctionRemove(AuctionHouseObject* /*ah*/, Aucti
// Get the configuration for the auction house
//

AuctionHouseEntry const* ahEntry = sAuctionHouseStore.LookupEntry(auction->GetHouseId());
AuctionHouseEntry const* ahEntry = sAuctionMgr->GetAuctionHouseEntryFromHouse(auction->GetHouseId());
AHBConfig* config = gNeutralConfig;

if (ahEntry)
{
if (ahEntry->houseId == AUCTIONHOUSE_ALLIANCE)
if (AuctionHouseId(ahEntry->houseId) == AuctionHouseId::Alliance)
{
config = gAllianceConfig;
}
else if (ahEntry->houseId == AUCTIONHOUSE_HORDE)
else if (AuctionHouseId(ahEntry->houseId) == AuctionHouseId::Horde)
{
config = gHordeConfig;
}
Expand Down Expand Up @@ -210,16 +210,16 @@ void AHBot_AuctionHouseScript::OnAuctionSuccessful(AuctionHouseObject* /*ah*/, A
// Get the configuration for the auction house
//

AuctionHouseEntry const* ahEntry = sAuctionHouseStore.LookupEntry(auction->GetHouseId());
AuctionHouseEntry const* ahEntry = sAuctionMgr->GetAuctionHouseEntryFromHouse(auction->GetHouseId());
AHBConfig* config = gNeutralConfig;

if (ahEntry)
{
if (ahEntry->houseId == AUCTIONHOUSE_ALLIANCE)
if (AuctionHouseId(ahEntry->houseId) == AuctionHouseId::Alliance)
{
config = gAllianceConfig;
}
else if (ahEntry->houseId == AUCTIONHOUSE_HORDE)
else if (AuctionHouseId(ahEntry->houseId) == AuctionHouseId::Horde)
{
config = gHordeConfig;
}
Expand All @@ -239,16 +239,16 @@ void AHBot_AuctionHouseScript::OnAuctionExpire(AuctionHouseObject* /*ah*/, Aucti
// Get the configuration for the auction house
//

AuctionHouseEntry const* ahEntry = sAuctionHouseStore.LookupEntry(auction->GetHouseId());
AuctionHouseEntry const* ahEntry = sAuctionMgr->GetAuctionHouseEntryFromHouse(auction->GetHouseId());
AHBConfig* config = gNeutralConfig;

if (ahEntry)
{
if (ahEntry->houseId == AUCTIONHOUSE_ALLIANCE)
if (AuctionHouseId(ahEntry->houseId) == AuctionHouseId::Alliance)
{
config = gAllianceConfig;
}
else if (ahEntry->houseId == AUCTIONHOUSE_HORDE)
else if (AuctionHouseId(ahEntry->houseId) == AuctionHouseId::Horde)
{
config = gHordeConfig;
}
Expand Down

0 comments on commit b4e1653

Please sign in to comment.