mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
potential fix for #469 (not 100% sure as can't reproduce)
This commit is contained in:
@@ -578,18 +578,10 @@ void RandomPlayerbotMgr::CheckBgQueue()
|
|||||||
if (!BgCheckTimer)
|
if (!BgCheckTimer)
|
||||||
BgCheckTimer = time(nullptr);
|
BgCheckTimer = time(nullptr);
|
||||||
|
|
||||||
uint32 count = 0;
|
if (time(nullptr) < BgCheckTimer + 30)
|
||||||
uint32 visual_count = 0;
|
|
||||||
|
|
||||||
uint32 check_time = count > 0 ? 120 : 30;
|
|
||||||
if (time(nullptr) < (BgCheckTimer + check_time))
|
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
else
|
BgCheckTimer = time(nullptr);
|
||||||
{
|
|
||||||
BgCheckTimer = time(nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
LOG_INFO("playerbots", "Checking BG Queue...");
|
LOG_INFO("playerbots", "Checking BG Queue...");
|
||||||
|
|
||||||
@@ -600,7 +592,8 @@ void RandomPlayerbotMgr::CheckBgQueue()
|
|||||||
if (!player->InBattlegroundQueue())
|
if (!player->InBattlegroundQueue())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (player->InBattleground() && player->GetBattleground()->GetStatus() == STATUS_WAIT_LEAVE)
|
Battleground* bg = player->GetBattleground();
|
||||||
|
if (bg && bg->GetStatus() == STATUS_WAIT_LEAVE)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
TeamId teamId = player->GetTeamId();
|
TeamId teamId = player->GetTeamId();
|
||||||
@@ -611,7 +604,7 @@ void RandomPlayerbotMgr::CheckBgQueue()
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
BattlegroundTypeId bgTypeId = sBattlegroundMgr->BGTemplateId(queueTypeId);
|
BattlegroundTypeId bgTypeId = sBattlegroundMgr->BGTemplateId(queueTypeId);
|
||||||
Battleground* bg = sBattlegroundMgr->GetBattlegroundTemplate(bgTypeId);
|
bg = sBattlegroundMgr->GetBattlegroundTemplate(bgTypeId);
|
||||||
uint32 mapId = bg->GetMapId();
|
uint32 mapId = bg->GetMapId();
|
||||||
PvPDifficultyEntry const* pvpDiff = GetBattlegroundBracketByLevel(mapId, player->GetLevel());
|
PvPDifficultyEntry const* pvpDiff = GetBattlegroundBracketByLevel(mapId, player->GetLevel());
|
||||||
if (!pvpDiff)
|
if (!pvpDiff)
|
||||||
@@ -690,7 +683,8 @@ void RandomPlayerbotMgr::CheckBgQueue()
|
|||||||
if (!IsRandomBot(bot))
|
if (!IsRandomBot(bot))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (bot->InBattleground() && bot->GetBattleground()->GetStatus() == STATUS_WAIT_LEAVE)
|
Battleground* bg = bot->GetBattleground();
|
||||||
|
if (bg && bg->GetStatus() == STATUS_WAIT_LEAVE)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
TeamId teamId = bot->GetTeamId();
|
TeamId teamId = bot->GetTeamId();
|
||||||
@@ -702,7 +696,7 @@ void RandomPlayerbotMgr::CheckBgQueue()
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
BattlegroundTypeId bgTypeId = sBattlegroundMgr->BGTemplateId(queueTypeId);
|
BattlegroundTypeId bgTypeId = sBattlegroundMgr->BGTemplateId(queueTypeId);
|
||||||
Battleground* bg = sBattlegroundMgr->GetBattlegroundTemplate(bgTypeId);
|
bg = sBattlegroundMgr->GetBattlegroundTemplate(bgTypeId);
|
||||||
uint32 mapId = bg->GetMapId();
|
uint32 mapId = bg->GetMapId();
|
||||||
PvPDifficultyEntry const* pvpDiff = GetBattlegroundBracketByLevel(mapId, bot->GetLevel());
|
PvPDifficultyEntry const* pvpDiff = GetBattlegroundBracketByLevel(mapId, bot->GetLevel());
|
||||||
if (!pvpDiff)
|
if (!pvpDiff)
|
||||||
|
|||||||
Reference in New Issue
Block a user