From ec0a092825d76c6f849d3393653c5d89b504c53e Mon Sep 17 00:00:00 2001 From: "Veit F." Date: Thu, 12 Jun 2025 02:42:16 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20=E2=9A=A1=20added=20missing=20guildTaskE?= =?UTF-8?q?nabled=20checks=20for=20GuildTaskMgr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Even if guildTaskEnabled was set to 0 in the configuration file, a few queries like PLAYERBOTS_SEL_GUILD_TASKS_BY_VALUE, PLAYERBOTS_SEL_GUILD_TASKS_BY_OWNER were executed, which lead to a massive amount of unnecessary database load --- src/GuildTaskMgr.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/GuildTaskMgr.cpp b/src/GuildTaskMgr.cpp index 0ad8b770..e09d1341 100644 --- a/src/GuildTaskMgr.cpp +++ b/src/GuildTaskMgr.cpp @@ -525,6 +525,11 @@ uint32 GuildTaskMgr::GetMaxItemTaskCount(uint32 itemId) bool GuildTaskMgr::IsGuildTaskItem(uint32 itemId, uint32 guildId) { + if (!sPlayerbotAIConfig->guildTaskEnabled) + { + return 0; + } + uint32 value = 0; PlayerbotsDatabasePreparedStatement* stmt = @@ -548,6 +553,11 @@ bool GuildTaskMgr::IsGuildTaskItem(uint32 itemId, uint32 guildId) std::map GuildTaskMgr::GetTaskValues(uint32 owner, std::string const type, [[maybe_unused]] uint32* validIn /* = nullptr */) { + if (!sPlayerbotAIConfig->guildTaskEnabled) + { + return std::map(); + } + std::map results; PlayerbotsDatabasePreparedStatement* stmt = @@ -576,6 +586,11 @@ std::map GuildTaskMgr::GetTaskValues(uint32 owner, std::string c uint32 GuildTaskMgr::GetTaskValue(uint32 owner, uint32 guildId, std::string const type, [[maybe_unused]] uint32* validIn /* = nullptr */) { + if (!sPlayerbotAIConfig->guildTaskEnabled) + { + return 0; + } + uint32 value = 0; PlayerbotsDatabasePreparedStatement* stmt =