mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
BG: Final fix against potential inconsistencies
* Check both bgInstanceCount / bgInstances.size to help counter against possible inconsistencies * Final fix against inconsistencies
This commit is contained in:
@@ -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<uint32> abBrackets = parseBrackets(sPlayerbotAIConfig->randomBotAutoJoinABBrackets);
|
||||
std::vector<uint32> 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user