From 4e7d00b1a3c699a7a1bad39c10cc13441e81a139 Mon Sep 17 00:00:00 2001 From: SaW Date: Wed, 22 Jan 2025 16:44:44 +0100 Subject: [PATCH] BG: restore !bot->IsInWorld() check (#891) * Update RandomPlayerbotMgr.cpp * Restore !bot->IsInWorld() --- src/RandomPlayerbotMgr.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/RandomPlayerbotMgr.cpp b/src/RandomPlayerbotMgr.cpp index b3a24240..456e91f3 100644 --- a/src/RandomPlayerbotMgr.cpp +++ b/src/RandomPlayerbotMgr.cpp @@ -654,6 +654,7 @@ void RandomPlayerbotMgr::CheckBgQueue() LOG_DEBUG("playerbots", "Checking BG Queue..."); // Initialize Battleground Data (do not clear here) + for (int bracket = BG_BRACKET_ID_FIRST; bracket < MAX_BATTLEGROUND_BRACKETS; ++bracket) { for (int queueType = BATTLEGROUND_QUEUE_AV; queueType < MAX_BATTLEGROUND_QUEUE_TYPES; ++queueType) @@ -756,7 +757,7 @@ void RandomPlayerbotMgr::CheckBgQueue() // Process player bots for (auto& [guid, bot] : playerBots) { - if (!bot || !bot->InBattlegroundQueue() || !IsRandomBot(bot)) + if (!bot || !bot->InBattlegroundQueue() || !bot->IsInWorld() || !IsRandomBot(bot)) continue; Battleground* bg = bot->GetBattleground(); @@ -874,7 +875,7 @@ void RandomPlayerbotMgr::CheckBgQueue() std::vector wsBrackets = parseBrackets(sPlayerbotAIConfig->randomBotAutoJoinWSBrackets); // Check both bgInstanceCount / bgInstances.size - // to help counter against inconsistencies + // to help counter against potentional inconsistencies auto updateRatedArenaInstanceCount = [&](uint32 queueType, uint32 bracket, uint32 minCount) { if (BattlegroundData[queueType][bracket].activeRatedArenaQueue == 0 && BattlegroundData[queueType][bracket].ratedArenaInstanceCount < minCount && @@ -978,7 +979,7 @@ void RandomPlayerbotMgr::LogBattlegroundInfo() std::to_string(bgInfo.minLevel) + "-" + std::to_string(bgInfo.maxLevel), bgInfo.bgAlliancePlayerCount, bgInfo.bgHordePlayerCount, bgInfo.bgAllianceBotCount, bgInfo.bgHordeBotCount, bgInfo.bgAlliancePlayerCount + bgInfo.bgAllianceBotCount, - bgInfo.bgHordePlayerCount + bgInfo.bgHordeBotCount, bgInfo.bgInstanceCount, bgInfo.activeBgQueue); + bgInfo.bgHordePlayerCount + bgInfo.bgHordeBotCount, bgInfo.bgInstanceCount, bgInfo.activeBgQueue); } } LOG_DEBUG("playerbots", "BG Queue check finished");