Skip to content

Commit

Permalink
Revert: Fix bots joining bgs and ignoring amount limit
Browse files Browse the repository at this point in the history
  • Loading branch information
davidonete committed Jan 19, 2025
1 parent 9ca2f1b commit 6fd62c1
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions playerbot/strategy/actions/BattleGroundJoinAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -490,14 +490,9 @@ bool BGJoinAction::shouldJoinBg(BattleGroundQueueTypeId queueTypeId, BattleGroun
if (!isArena && bot->GetGroup() && !bot->GetGroup()->IsLeader(bot->GetObjectGuid()))
return false;

// do not join if BG queue is full
if (BgCount >= BracketSize && (ACount >= TeamSize) && (HCount >= TeamSize))
{
return false;
}
bool needBots = sRandomPlayerbotMgr.NeedBots[queueTypeId][bracketId][isArena ? isRated : GetTeamIndexByTeamId(bot->GetTeam())];

// add more bots if players are not invited or if 1st BG instance is full
bool needBots = sRandomPlayerbotMgr.NeedBots[queueTypeId][bracketId][isArena ? isRated : GetTeamIndexByTeamId(bot->GetTeam())];
if (needBots || (hasPlayers && BgCount > BracketSize && (BgCount % BracketSize) != 0))
{
bool needAlly = HCount >= ACount;
Expand All @@ -517,6 +512,12 @@ bool BGJoinAction::shouldJoinBg(BattleGroundQueueTypeId queueTypeId, BattleGroun
}
}

// do not join if BG queue is full
if (BgCount >= BracketSize && (ACount >= TeamSize) && (HCount >= TeamSize))
{
return false;
}

if (!isArena && ((ACount >= TeamSize && TeamId == 0) || (HCount >= TeamSize && TeamId == 1)))
{
return false;
Expand Down Expand Up @@ -1330,6 +1331,8 @@ bool BGStatusAction::Execute(Event& event)
// temp fix for crash
//return true;

/*
// TO DO: Fix for wotlk
#ifdef MANGOSBOT_TWO
BattleGroundQueue& bgQueue = sServerFacade.bgQueue(queueTypeId);
GroupQueueInfo ginfo;
Expand Down Expand Up @@ -1416,8 +1419,9 @@ bool BGStatusAction::Execute(Event& event)
return true;
}
#else
*/
return true;
#endif
//#endif
}
if (statusid == STATUS_IN_PROGRESS) // placeholder for Leave BG if it takes too long
{
Expand Down

0 comments on commit 6fd62c1

Please sign in to comment.