From 61333a02bfc7478c9c1ecf00832b52d2e076ec22 Mon Sep 17 00:00:00 2001 From: SaW Date: Wed, 19 Feb 2025 09:46:28 +0100 Subject: [PATCH] Avoid creating accounts if both maxRandom & ClassBots are set to zero (#984) Fix for https://github.com/liyunfan1223/mod-playerbots/issues/978 --- src/RandomPlayerbotFactory.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/RandomPlayerbotFactory.cpp b/src/RandomPlayerbotFactory.cpp index bd4dab5c..761be7dc 100644 --- a/src/RandomPlayerbotFactory.cpp +++ b/src/RandomPlayerbotFactory.cpp @@ -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;