Skip to content

Commit

Permalink
fix: do not use transmog plus if disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Helias committed Sep 8, 2024
1 parent 2c928ec commit ca228f2
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/transmog_scripts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1148,15 +1148,17 @@ class PS_Transmogrification : public PlayerScript
}
}

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())
Expand Down

0 comments on commit ca228f2

Please sign in to comment.