mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-02-01 18:03:47 +00:00
fix: ⚡ added missing guildTaskEnabled checks for GuildTaskMgr
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
This commit is contained in:
@@ -525,6 +525,11 @@ uint32 GuildTaskMgr::GetMaxItemTaskCount(uint32 itemId)
|
|||||||
|
|
||||||
bool GuildTaskMgr::IsGuildTaskItem(uint32 itemId, uint32 guildId)
|
bool GuildTaskMgr::IsGuildTaskItem(uint32 itemId, uint32 guildId)
|
||||||
{
|
{
|
||||||
|
if (!sPlayerbotAIConfig->guildTaskEnabled)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
uint32 value = 0;
|
uint32 value = 0;
|
||||||
|
|
||||||
PlayerbotsDatabasePreparedStatement* stmt =
|
PlayerbotsDatabasePreparedStatement* stmt =
|
||||||
@@ -548,6 +553,11 @@ bool GuildTaskMgr::IsGuildTaskItem(uint32 itemId, uint32 guildId)
|
|||||||
std::map<uint32, uint32> GuildTaskMgr::GetTaskValues(uint32 owner, std::string const type,
|
std::map<uint32, uint32> GuildTaskMgr::GetTaskValues(uint32 owner, std::string const type,
|
||||||
[[maybe_unused]] uint32* validIn /* = nullptr */)
|
[[maybe_unused]] uint32* validIn /* = nullptr */)
|
||||||
{
|
{
|
||||||
|
if (!sPlayerbotAIConfig->guildTaskEnabled)
|
||||||
|
{
|
||||||
|
return std::map<uint32, uint32>();
|
||||||
|
}
|
||||||
|
|
||||||
std::map<uint32, uint32> results;
|
std::map<uint32, uint32> results;
|
||||||
|
|
||||||
PlayerbotsDatabasePreparedStatement* stmt =
|
PlayerbotsDatabasePreparedStatement* stmt =
|
||||||
@@ -576,6 +586,11 @@ std::map<uint32, uint32> GuildTaskMgr::GetTaskValues(uint32 owner, std::string c
|
|||||||
|
|
||||||
uint32 GuildTaskMgr::GetTaskValue(uint32 owner, uint32 guildId, std::string const type, [[maybe_unused]] uint32* validIn /* = nullptr */)
|
uint32 GuildTaskMgr::GetTaskValue(uint32 owner, uint32 guildId, std::string const type, [[maybe_unused]] uint32* validIn /* = nullptr */)
|
||||||
{
|
{
|
||||||
|
if (!sPlayerbotAIConfig->guildTaskEnabled)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
uint32 value = 0;
|
uint32 value = 0;
|
||||||
|
|
||||||
PlayerbotsDatabasePreparedStatement* stmt =
|
PlayerbotsDatabasePreparedStatement* stmt =
|
||||||
|
|||||||
Reference in New Issue
Block a user