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:
SylvaniaCore deploy
2026-06-17 09:02:32 +00:00
parent 06130f3d0c
commit 233677007b
2 changed files with 10 additions and 2 deletions
@@ -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();
+6 -2
View File
@@ -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));