Skip to content

Commit

Permalink
fix(Subscriptions): Set membership level to 0 if no row is found (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyeriah authored Nov 21, 2024
1 parent 625d452 commit 4800a5c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/transmog_scripts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1156,9 +1156,7 @@ class PS_Transmogrification : public PlayerScript
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);

if (resultAcc)
player->UpdatePlayerSetting("acore_cms_subscriptions", SETTING_TRANSMOG_MEMBERSHIP_LEVEL, (*resultAcc)[0].Get<uint32>());
player->UpdatePlayerSetting("acore_cms_subscriptions", SETTING_TRANSMOG_MEMBERSHIP_LEVEL, resultAcc ? (*resultAcc)[0].Get<uint32>() : 0);
}

#ifdef PRESETS
Expand Down

0 comments on commit 4800a5c

Please sign in to comment.