Check BG queue even if no players online

This commit is contained in:
郑佩茹
2023-03-21 10:44:01 -06:00
parent e1e74c9c2b
commit 9344abe639

View File

@@ -264,7 +264,7 @@ void RandomPlayerbotMgr::UpdateAIInternal(uint32 elapsed, bool /*minimal*/)
activateCheckPlayersThread(); activateCheckPlayersThread();
} }
if (sPlayerbotAIConfig->randomBotJoinBG && !players.empty()) if (sPlayerbotAIConfig->randomBotJoinBG/* && !players.empty()*/)
{ {
if (time(nullptr) > (BgCheckTimer + 30)) if (time(nullptr) > (BgCheckTimer + 30))
activateCheckBgQueueThread(); activateCheckBgQueueThread();
@@ -1403,7 +1403,12 @@ bool RandomPlayerbotMgr::IsRandomBot(Player* bot)
return false; return false;
} }
if (bot) 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; return false;
} }
@@ -1411,7 +1416,10 @@ bool RandomPlayerbotMgr::IsRandomBot(Player* bot)
bool RandomPlayerbotMgr::IsRandomBot(ObjectGuid::LowType bot) bool RandomPlayerbotMgr::IsRandomBot(ObjectGuid::LowType bot)
{ {
ObjectGuid guid = ObjectGuid::Create<HighGuid::Player>(bot); ObjectGuid guid = ObjectGuid::Create<HighGuid::Player>(bot);
return GetEventValue(bot, "add") || sPlayerbotAIConfig->IsInRandomAccountList(sCharacterCache->GetCharacterAccountIdByGuid(guid)); if (sPlayerbotAIConfig->IsInRandomAccountList(sCharacterCache->GetCharacterAccountIdByGuid(guid)))
return true;
return GetEventValue(bot, "add");
} }
std::list<uint32> RandomPlayerbotMgr::GetBots() std::list<uint32> RandomPlayerbotMgr::GetBots()