fix(playerbot): desactive tous les bots via pbotall=0 (serveur blizzlike) + corrige le crash issue #56 (irand min>max du tick BG/arene)
This commit is contained in:
@@ -924,6 +924,8 @@ void PlayerBotMgr::UpdateLastAccountIndex(std::string& username)
|
||||
|
||||
void PlayerBotMgr::SupplementAccount()
|
||||
{
|
||||
if (!sConfigMgr->GetIntDefault("pbotall", 1)) // SylvaniaCore: serveur sans bots -> pas de comptes PLAYERBOT
|
||||
return;
|
||||
uint32 needAccount = m_BotAccountAmount * 2 - m_idPlayerBotBase.size();
|
||||
if (needAccount <= 0)
|
||||
return;
|
||||
@@ -3327,6 +3329,8 @@ uint32 PlayerBotMgr::GetOnlineBotCount2(TeamId team, bool hasReal)
|
||||
|
||||
void PlayerBotMgr::Update()
|
||||
{
|
||||
if (!sConfigMgr->GetIntDefault("pbotall", 1)) // SylvaniaCore: serveur sans bots -> tick bot inerte (evite crash #56 sur file BG/arene)
|
||||
return;
|
||||
|
||||
OnlinePlayerBotByGUIDQueue();
|
||||
|
||||
|
||||
@@ -2670,8 +2670,12 @@ void World::SetInitialWorldSettings()
|
||||
|
||||
uint32 startupDuration = GetMSTimeDiffToNow(startupBegin);
|
||||
|
||||
sPlayerBotMgr->UpAllPlayerBotSession();
|
||||
sPlayerBotMgr->SupplementOneRandomPlayerBotPerAccount();
|
||||
// SylvaniaCore: serveur blizzlike sans PlayerBots. pbotall=0 desactive toute creation/session de bot au demarrage.
|
||||
if (sConfigMgr->GetIntDefault("pbotall", 1))
|
||||
{
|
||||
sPlayerBotMgr->UpAllPlayerBotSession();
|
||||
sPlayerBotMgr->SupplementOneRandomPlayerBotPerAccount();
|
||||
}
|
||||
|
||||
TC_LOG_INFO("server.worldserver", "World initialized in %u minutes %u seconds", (startupDuration / 60000), ((startupDuration % 60000) / 1000));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user