fix: do not use transmog plus if disabled (#177)

* fix: do not use transmog plus if disabled

* Update src/transmog_scripts.cpp

---------

Co-authored-by: Andrew <47818697+Nyeriah@users.noreply.github.com>
This commit is contained in:
Stefano Borzì
2024-09-09 00:22:33 +02:00
committed by GitHub
parent 2c928ec67c
commit 831572e79d

View File

@@ -1148,15 +1148,18 @@ public:
}
}
uint32 accountId = 0;
if (sConfigMgr->GetOption<bool>("Transmogrification.EnablePlus", false))
{
uint32 accountId = 0;
if (player->GetSession())
accountId = player->GetSession()->GetAccountId();
if (player->GetSession())
accountId = player->GetSession()->GetAccountId();
QueryResult resultAcc = LoginDatabase.Query("SELECT `membership_level` FROM `acore_cms_subscriptions` WHERE `account_name` COLLATE utf8mb4_general_ci = (SELECT `username` FROM `account` WHERE `id` = {})", accountId);
QueryResult resultAcc = LoginDatabase.Query("SELECT `membership_level` FROM `acore_cms_subscriptions` WHERE `account_name` COLLATE utf8mb4_general_ci = (SELECT `username` FROM `account` WHERE `id` = {})", accountId);
if (resultAcc)
player->UpdatePlayerSetting("acore_cms_subscriptions", SETTING_TRANSMOG_MEMBERSHIP_LEVEL, (*resultAcc)[0].Get<uint32>());
if (resultAcc)
player->UpdatePlayerSetting("acore_cms_subscriptions", SETTING_TRANSMOG_MEMBERSHIP_LEVEL, (*resultAcc)[0].Get<uint32>());
}
#ifdef PRESETS
if (sT->GetEnableSets())