From 58a596a40e49a450505c03321e694468dcf23b4a Mon Sep 17 00:00:00 2001 From: SaW Date: Sun, 16 Feb 2025 13:42:15 +0100 Subject: [PATCH] Only invoke InitGuild when randomBotGuildCount > 0 (#975) * Only invoke InitGuild when randomBotGuildCount > 0 * Moved Random bot guild count/delete to more appropriate section of config. --- conf/playerbots.conf.dist | 12 ++++++------ src/factory/PlayerbotFactory.cpp | 7 +++++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/conf/playerbots.conf.dist b/conf/playerbots.conf.dist index 7c851dd8..35b75442 100644 --- a/conf/playerbots.conf.dist +++ b/conf/playerbots.conf.dist @@ -132,6 +132,12 @@ AiPlayerbot.AllowAccountBots = 1 # Allow/deny bots in the player's guild AiPlayerbot.AllowGuildBots = 1 +# Random bot guild count +AiPlayerbot.RandomBotGuildCount = 20 + +# Delete all random bot guilds +AiPlayerbot.DeleteRandomBotGuilds = 0 + # Randombots will invite nearby bots to guilds AiPlayerbot.RandomBotGuildNearby = 0 @@ -1622,12 +1628,6 @@ AiPlayerbot.EnableGuildTasks = 0 # Enable dungeon suggestions in lower case randomly AiPlayerbot.SuggestDungeonsInLowerCaseRandomly = 0 -# Random bot guild count -AiPlayerbot.RandomBotGuildCount = 20 - -# Delete all random bot guilds -AiPlayerbot.DeleteRandomBotGuilds = 0 - # Chance bot chooses RPG (Teleport to random camp for their level) instead of grinding AiPlayerbot.RandomBotRpgChance = 0.20 diff --git a/src/factory/PlayerbotFactory.cpp b/src/factory/PlayerbotFactory.cpp index 54961060..e1a217e2 100644 --- a/src/factory/PlayerbotFactory.cpp +++ b/src/factory/PlayerbotFactory.cpp @@ -392,9 +392,12 @@ void PlayerbotFactory::Randomize(bool incremental) // bot->SaveToDB(false, false); // pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Guilds"); - // LOG_INFO("playerbots", "Initializing guilds..."); // bot->SaveToDB(false, false); - InitGuild(); + if (sPlayerbotAIConfig->randomBotGuildCount > 0) + { + LOG_INFO("playerbots", "Initializing guilds..."); + InitGuild(); + } // bot->SaveToDB(false, false); // if (pmo) // pmo->finish();