diff --git a/src/server/game/AI/NpcBots/botdatamgr.cpp b/src/server/game/AI/NpcBots/botdatamgr.cpp index f30cb5ed4c43e3..c844d9a9dd6a44 100644 --- a/src/server/game/AI/NpcBots/botdatamgr.cpp +++ b/src/server/game/AI/NpcBots/botdatamgr.cpp @@ -1403,11 +1403,18 @@ bool BotDataMgr::GenerateBattlegroundBots(Player const* groupLeader, [[maybe_unu for (auto const& real_bg_pair : kv.second._Battlegrounds) { Battleground const* real_bg = real_bg_pair.second; - if (real_bg->GetInstanceID() != 0 && real_bg->GetBracketId() == bracketId && - real_bg->GetStatus() < STATUS_WAIT_LEAVE && real_bg->HasFreeSlots()) + if (real_bg->GetInstanceID() != 0 && real_bg->GetBracketId() == bracketId && real_bg->GetStatus() < STATUS_WAIT_LEAVE && real_bg->HasFreeSlots()) { - LOG_INFO("npcbots", "[Already running] Found running BG {} inited by player {} ({}). Not generating bots", - uint32(bgTypeId), groupLeader->GetName().c_str(), groupLeader->GetGUID().GetCounter()); + if (real_bg->GetFreeSlotsForTeam(groupLeader->GetTeamId()) < gqinfo->Players.size()) + { + LOG_INFO("npcbots", "[Already running 1] Found running non-full BG {} instance {}. Not generating bots: queuing group or player (leader {}) CANNOT join existing BG, prevent borrowing bots", + uint32(bgTypeId), real_bg->GetInstanceID(), groupLeader->GetGUID().GetCounter()); + } + else + { + LOG_INFO("npcbots", "[Already running 2] Found running non-full BG {} instance {}. Not generating bots: queuing group or player (leader {}) CAN join existing BG", + uint32(bgTypeId), real_bg->GetInstanceID(), groupLeader->GetGUID().GetCounter()); + } return true; } }