From 2c928ec67c8def7bfc03376506aa6fb0fc1d0ecb Mon Sep 17 00:00:00 2001 From: Andrew <47818697+Nyeriah@users.noreply.github.com> Date: Sat, 7 Sep 2024 08:08:42 -0300 Subject: [PATCH] refactor: Move subscriptions to its own setting (#176) --- src/Transmogrification.h | 6 ++++-- src/transmog_scripts.cpp | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Transmogrification.h b/src/Transmogrification.h index 8c910cc..ab1743d 100644 --- a/src/Transmogrification.h +++ b/src/Transmogrification.h @@ -29,7 +29,9 @@ enum TransmogSettings { SETTING_HIDE_TRANSMOG = 0, SETTING_RETROACTIVE_CHECK = 1, - SETTING_TRANSMOG_MEMBERSHIP_LEVEL = 2 + + // Subscriptions + SETTING_TRANSMOG_MEMBERSHIP_LEVEL = 0 }; enum MixedWeaponSettings @@ -271,7 +273,7 @@ public: // Transmog Plus bool IsTransmogPlusEnabled; [[nodiscard]] bool IsPlusFeatureEligible(ObjectGuid const& playerGuid, uint32 feature) const; - [[nodiscard]] uint32 GetPlayerMembershipLevel(Player* player) const { return player->GetPlayerSetting("mod-transmog", SETTING_TRANSMOG_MEMBERSHIP_LEVEL).value; }; + [[nodiscard]] uint32 GetPlayerMembershipLevel(Player* player) const { return player->GetPlayerSetting("acore_cms_subscriptions", SETTING_TRANSMOG_MEMBERSHIP_LEVEL).value; }; [[nodiscard]] bool IgnoreLevelRequirement(ObjectGuid const& playerGuid) const { return IgnoreReqLevel || IsPlusFeatureEligible(playerGuid, PLUS_FEATURE_SKIP_LEVEL_REQ); } uint32 PetSpellId; diff --git a/src/transmog_scripts.cpp b/src/transmog_scripts.cpp index ed3e971..c5b20b5 100644 --- a/src/transmog_scripts.cpp +++ b/src/transmog_scripts.cpp @@ -1156,7 +1156,7 @@ public: 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("mod-transmog", SETTING_TRANSMOG_MEMBERSHIP_LEVEL, (*resultAcc)[0].Get()); + player->UpdatePlayerSetting("acore_cms_subscriptions", SETTING_TRANSMOG_MEMBERSHIP_LEVEL, (*resultAcc)[0].Get()); #ifdef PRESETS if (sT->GetEnableSets())