Skip to content

Commit

Permalink
NPCBots: Fix a bug where no new BG bots were generated even if all ex…
Browse files Browse the repository at this point in the history
…isting BGs are full. Improve log

(cherry picked from commit 86c6c26bba6725336c3742e7ba2285e782b32a4d)

# Conflicts:
#	src/server/game/AI/NpcBots/botdatamgr.cpp
#	src/server/game/Battlegrounds/Battleground.cpp
  • Loading branch information
trickerer committed May 24, 2024
1 parent a9a17eb commit f5de253
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/server/game/AI/NpcBots/botdatamgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit f5de253

Please sign in to comment.