Avoid creating accounts if both maxRandom & ClassBots are set to zero (#984)

Fix for https://github.com/liyunfan1223/mod-playerbots/issues/978
This commit is contained in:
SaW
2025-02-19 09:46:28 +01:00
committed by GitHub
parent bb729e35b9
commit 61333a02bf

View File

@@ -401,9 +401,12 @@ uint32 RandomPlayerbotFactory::CalculateTotalAccountCount()
// Checks if randomBotAccountCount is set, otherwise calculate it dynamically.
if (sPlayerbotAIConfig->randomBotAccountCount > 0)
{
return sPlayerbotAIConfig->randomBotAccountCount;
}
// Avoid creating accounts if both maxRandom & ClassBots are set to zero.
if (sPlayerbotAIConfig->maxRandomBots == 0 &&
sPlayerbotAIConfig->addClassAccountPoolSize == 0)
return 0;
bool isWOTLK = sWorld->getIntConfig(CONFIG_EXPANSION) == EXPANSION_WRATH_OF_THE_LICH_KING;