Skip to content

Commit

Permalink
fix: Fix logic and improve readibility (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyeriah authored Aug 17, 2024
1 parent 63e226d commit 21f5eaf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Transmogrification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ bool Transmogrification::SuitableForTransmogrification(Player* player, ItemTempl
return false;
}

if (!IgnoreReqLevel && IsPlusFeatureEligible(player->GetGUID(), PLUS_FEATURE_SKIP_LEVEL_REQ) && player->GetLevel() < proto->RequiredLevel)
if (!IgnoreLevelRequirement(player->GetGUID()) && player->GetLevel() < proto->RequiredLevel)
return false;

if (AllowLowerTiers && TierAvailable(player, 0, proto->SubClass))
Expand Down Expand Up @@ -887,7 +887,7 @@ bool Transmogrification::SuitableForTransmogrification(ObjectGuid guid, ItemTemp
return false;
}

if (!IgnoreReqLevel && IsPlusFeatureEligible(guid, PLUS_FEATURE_SKIP_LEVEL_REQ) && playerLevel < proto->RequiredLevel)
if (!IgnoreLevelRequirement(guid) && IsPlusFeatureEligible(guid, PLUS_FEATURE_SKIP_LEVEL_REQ) && playerLevel < proto->RequiredLevel)
return false;

if (AllowLowerTiers && TierAvailable(NULL, playerGuid, proto->SubClass))
Expand Down
2 changes: 2 additions & 0 deletions src/Transmogrification.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,8 @@ class Transmogrification
[[nodiscard]] bool IsPlusFeatureEligible(ObjectGuid const& playerGuid, uint32 feature) const;
uint32 getPlayerMembershipLevel(ObjectGuid const & playerGuid) const;

[[nodiscard]] bool IgnoreLevelRequirement(ObjectGuid const& playerGuid) const { return IgnoreReqLevel || IsPlusFeatureEligible(playerGuid, PLUS_FEATURE_SKIP_LEVEL_REQ); }

};
#define sTransmogrification Transmogrification::instance()

Expand Down

0 comments on commit 21f5eaf

Please sign in to comment.