mirror of
https://github.com/azerothcore/mod-transmog
synced 2025-11-29 22:48:30 +08:00
fix: Fix logic and improve readibility (#164)
This commit is contained in:
@@ -798,7 +798,7 @@ bool Transmogrification::SuitableForTransmogrification(Player* player, ItemTempl
|
|||||||
return false;
|
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;
|
return false;
|
||||||
|
|
||||||
if (AllowLowerTiers && TierAvailable(player, 0, proto->SubClass))
|
if (AllowLowerTiers && TierAvailable(player, 0, proto->SubClass))
|
||||||
@@ -887,7 +887,7 @@ bool Transmogrification::SuitableForTransmogrification(ObjectGuid guid, ItemTemp
|
|||||||
return false;
|
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;
|
return false;
|
||||||
|
|
||||||
if (AllowLowerTiers && TierAvailable(NULL, playerGuid, proto->SubClass))
|
if (AllowLowerTiers && TierAvailable(NULL, playerGuid, proto->SubClass))
|
||||||
|
|||||||
@@ -263,6 +263,8 @@ public:
|
|||||||
[[nodiscard]] bool IsPlusFeatureEligible(ObjectGuid const& playerGuid, uint32 feature) const;
|
[[nodiscard]] bool IsPlusFeatureEligible(ObjectGuid const& playerGuid, uint32 feature) const;
|
||||||
uint32 getPlayerMembershipLevel(ObjectGuid const & playerGuid) 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()
|
#define sTransmogrification Transmogrification::instance()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user