From 9344abe6393d239d82ecc1d50b0a88fed5a81533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E4=BD=A9=E8=8C=B9?= Date: Tue, 21 Mar 2023 10:44:01 -0600 Subject: [PATCH] Check BG queue even if no players online --- src/RandomPlayerbotMgr.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/RandomPlayerbotMgr.cpp b/src/RandomPlayerbotMgr.cpp index 25aaaeb2..5033b352 100644 --- a/src/RandomPlayerbotMgr.cpp +++ b/src/RandomPlayerbotMgr.cpp @@ -264,7 +264,7 @@ void RandomPlayerbotMgr::UpdateAIInternal(uint32 elapsed, bool /*minimal*/) activateCheckPlayersThread(); } - if (sPlayerbotAIConfig->randomBotJoinBG && !players.empty()) + if (sPlayerbotAIConfig->randomBotJoinBG/* && !players.empty()*/) { if (time(nullptr) > (BgCheckTimer + 30)) activateCheckBgQueueThread(); @@ -1403,7 +1403,12 @@ bool RandomPlayerbotMgr::IsRandomBot(Player* bot) return false; } if (bot) - return IsRandomBot(bot->GetGUID().GetCounter()) || sPlayerbotAIConfig->IsInRandomAccountList(bot->GetSession()->GetAccountId()); + { + if (sPlayerbotAIConfig->IsInRandomAccountList(bot->GetSession()->GetAccountId())) + return true; + + return IsRandomBot(bot->GetGUID().GetCounter()); + } return false; } @@ -1411,7 +1416,10 @@ bool RandomPlayerbotMgr::IsRandomBot(Player* bot) bool RandomPlayerbotMgr::IsRandomBot(ObjectGuid::LowType bot) { ObjectGuid guid = ObjectGuid::Create(bot); - return GetEventValue(bot, "add") || sPlayerbotAIConfig->IsInRandomAccountList(sCharacterCache->GetCharacterAccountIdByGuid(guid)); + if (sPlayerbotAIConfig->IsInRandomAccountList(sCharacterCache->GetCharacterAccountIdByGuid(guid))) + return true; + + return GetEventValue(bot, "add"); } std::list RandomPlayerbotMgr::GetBots()