Skip to content

Commit

Permalink
-Internal: bg vanilla build fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
mostlikely4r committed Oct 9, 2024
1 parent 9179d48 commit cac788f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 21 deletions.
21 changes: 12 additions & 9 deletions playerbot/RandomPlayerbotMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1139,10 +1139,12 @@ void RandomPlayerbotMgr::CheckBgQueue()
uint32 TeamId = player->GetTeam() == ALLIANCE ? 0 : 1;

BattleGroundTypeId bgTypeId = sServerFacade.BgTemplateId(queueTypeId);
#ifdef MANGOS
#ifdef MANGOSBOT_ZERO
BattleGroundBracketId bracketId = player->GetBattleGroundBracketIdFromLevel(bgTypeId);
#endif
#ifdef CMANGOS
#ifdef MANGOSBOT_ONE
BattleGroundBracketId bracketId = sBattleGroundMgr.GetBattleGroundBracketIdFromLevel(bgTypeId, player->GetLevel());
#endif
#ifdef MANGOSBOT_TWO
BattleGround* bg = sBattleGroundMgr.GetBattleGroundTemplate(bgTypeId);
uint32 mapId = bg->GetMapId();
Expand All @@ -1151,9 +1153,6 @@ void RandomPlayerbotMgr::CheckBgQueue()
continue;

BattleGroundBracketId bracketId = pvpDiff->GetBracketId();
#else
BattleGroundBracketId bracketId = sBattleGroundMgr.GetBattleGroundBracketIdFromLevel(bgTypeId, player->GetLevel());
#endif
#endif
#ifdef MANGOSBOT_TWO
if (ArenaType arenaType = sServerFacade.BgArenaType(queueTypeId))
Expand Down Expand Up @@ -1279,6 +1278,13 @@ void RandomPlayerbotMgr::CheckBgQueue()
uint32 TeamId = bot->GetTeam() == ALLIANCE ? 0 : 1;

BattleGroundTypeId bgTypeId = sServerFacade.BgTemplateId(queueTypeId);

#ifdef MANGOSBOT_ZERO
BattleGroundBracketId bracketId = bot->GetBattleGroundBracketIdFromLevel(bgTypeId);
#endif
#ifdef MANGOSBOT_ONE
BattleGroundBracketId bracketId = sBattleGroundMgr.GetBattleGroundBracketIdFromLevel(bgTypeId, bot->GetLevel());;
#endif
#ifdef MANGOSBOT_TWO
BattleGround* bg = sBattleGroundMgr.GetBattleGroundTemplate(bgTypeId);
uint32 mapId = bg->GetMapId();
Expand All @@ -1287,11 +1293,8 @@ void RandomPlayerbotMgr::CheckBgQueue()
continue;

BattleGroundBracketId bracketId = pvpDiff->GetBracketId();
#else
BattleGroundBracketId bracketId = sBattleGroundMgr.GetBattleGroundBracketIdFromLevel(bgTypeId, bot->GetLevel());;
#endif

#ifdef MANGOSBOT_TWO
#ifdef MANGOSBOT_TWO
ArenaType arenaType = sServerFacade.BgArenaType(queueTypeId);
if (arenaType != ARENA_TYPE_NONE)
{
Expand Down
24 changes: 12 additions & 12 deletions playerbot/strategy/actions/BattleGroundJoinAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,24 +337,24 @@ bool BGJoinAction::canJoinBg(Player* player, BattleGroundQueueTypeId queueTypeId

// check bracket
#ifdef MANGOSBOT_ZERO
if (bracketId != bot->GetBattleGroundBracketIdFromLevel(bgTypeId);
return false;
if (bracketId != bot->GetBattleGroundBracketIdFromLevel(bgTypeId))
return false;
#endif
#ifdef MANGOSBOT_ONE
if (sBattleGroundMgr.GetBattleGroundBracketIdFromLevel(bgTypeId, bot->GetLevel()) != bracketId)
return false;
#endif
#ifdef MANGOSBOT_TWO
BattleGround* bg = sBattleGroundMgr.GetBattleGroundTemplate(bgTypeId);
uint32 mapId = bg->GetMapId();
PvPDifficultyEntry const* pvpDiff = GetBattlegroundBracketByLevel(mapId, player->GetLevel());
if (!pvpDiff)
return false;
BattleGround* bg = sBattleGroundMgr.GetBattleGroundTemplate(bgTypeId);
uint32 mapId = bg->GetMapId();
PvPDifficultyEntry const* pvpDiff = GetBattlegroundBracketByLevel(mapId, player->GetLevel());
if (!pvpDiff)
return false;

BattleGroundBracketId bracket_temp = pvpDiff->GetBracketId();
BattleGroundBracketId bracket_temp = pvpDiff->GetBracketId();

if (bracket_temp != bracketId)
return false;
if (bracket_temp != bracketId)
return false;
#endif
return true;
}
Expand Down Expand Up @@ -666,10 +666,10 @@ bool BGJoinAction::JoinQueue(uint32 type)

bracketId = pvpDiff->GetBracketId();
#endif
#ifdef MANGOSBOS_ZERO
#ifdef MANGOSBOT_ZERO
bracketId = bot->GetBattleGroundBracketIdFromLevel(bgTypeId);
#endif
#ifdef MANGOSBOS_ONE
#ifdef MANGOSBOT_ONE
bracketId = sBattleGroundMgr.GetBattleGroundBracketIdFromLevel(bgTypeId, bot->GetLevel());
#endif

Expand Down

0 comments on commit cac788f

Please sign in to comment.