Skip to content

Commit

Permalink
fix: do not use transmog plus if disabled (#177)
Browse files Browse the repository at this point in the history
* fix: do not use transmog plus if disabled

* Update src/transmog_scripts.cpp

---------

Co-authored-by: Andrew <[email protected]>
  • Loading branch information
Helias and Nyeriah authored Sep 8, 2024
1 parent 2c928ec commit 831572e
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/transmog_scripts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1148,15 +1148,18 @@ 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 831572e

Please sign in to comment.