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()
|
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();
|
uint32 needAccount = m_BotAccountAmount * 2 - m_idPlayerBotBase.size();
|
||||||
if (needAccount <= 0)
|
if (needAccount <= 0)
|
||||||
return;
|
return;
|
||||||
@@ -3327,6 +3329,8 @@ uint32 PlayerBotMgr::GetOnlineBotCount2(TeamId team, bool hasReal)
|
|||||||
|
|
||||||
void PlayerBotMgr::Update()
|
void PlayerBotMgr::Update()
|
||||||
{
|
{
|
||||||
|
if (!sConfigMgr->GetIntDefault("pbotall", 1)) // SylvaniaCore: serveur sans bots -> tick bot inerte (evite crash #56 sur file BG/arene)
|
||||||
|
return;
|
||||||
|
|
||||||
OnlinePlayerBotByGUIDQueue();
|
OnlinePlayerBotByGUIDQueue();
|
||||||
|
|
||||||
|
|||||||
@@ -2670,8 +2670,12 @@ void World::SetInitialWorldSettings()
|
|||||||
|
|
||||||
uint32 startupDuration = GetMSTimeDiffToNow(startupBegin);
|
uint32 startupDuration = GetMSTimeDiffToNow(startupBegin);
|
||||||
|
|
||||||
sPlayerBotMgr->UpAllPlayerBotSession();
|
// SylvaniaCore: serveur blizzlike sans PlayerBots. pbotall=0 desactive toute creation/session de bot au demarrage.
|
||||||
sPlayerBotMgr->SupplementOneRandomPlayerBotPerAccount();
|
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));
|
TC_LOG_INFO("server.worldserver", "World initialized in %u minutes %u seconds", (startupDuration / 60000), ((startupDuration % 60000) / 1000));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user