diff --git a/src/RandomPlayerbotMgr.cpp b/src/RandomPlayerbotMgr.cpp index a3c5d057..b3a24240 100644 --- a/src/RandomPlayerbotMgr.cpp +++ b/src/RandomPlayerbotMgr.cpp @@ -756,7 +756,7 @@ void RandomPlayerbotMgr::CheckBgQueue() // Process player bots for (auto& [guid, bot] : playerBots) { - if (!bot || !bot->InBattlegroundQueue() || !bot->IsInWorld() || !IsRandomBot(bot)) + if (!bot || !bot->InBattlegroundQueue() || !IsRandomBot(bot)) continue; Battleground* bg = bot->GetBattleground(); @@ -873,8 +873,11 @@ void RandomPlayerbotMgr::CheckBgQueue() std::vector abBrackets = parseBrackets(sPlayerbotAIConfig->randomBotAutoJoinABBrackets); std::vector wsBrackets = parseBrackets(sPlayerbotAIConfig->randomBotAutoJoinWSBrackets); + // Check both bgInstanceCount / bgInstances.size + // to help counter against inconsistencies auto updateRatedArenaInstanceCount = [&](uint32 queueType, uint32 bracket, uint32 minCount) { if (BattlegroundData[queueType][bracket].activeRatedArenaQueue == 0 && + BattlegroundData[queueType][bracket].ratedArenaInstanceCount < minCount && BattlegroundData[queueType][bracket].ratedArenaInstances.size() < minCount) BattlegroundData[queueType][bracket].activeRatedArenaQueue = 1; }; @@ -883,6 +886,7 @@ void RandomPlayerbotMgr::CheckBgQueue() for (uint32 bracket : brackets) { if (BattlegroundData[queueType][bracket].activeBgQueue == 0 && + BattlegroundData[queueType][bracket].bgInstanceCount < minCount && BattlegroundData[queueType][bracket].bgInstances.size() < minCount) BattlegroundData[queueType][bracket].activeBgQueue = 1; }