Fix Hunter pet XP at progression level caps

This commit is contained in:
郑佩茹
2023-07-07 10:57:20 -06:00
parent 8fc0986dc9
commit 410d3cd8e8

View File

@@ -130,7 +130,7 @@ public:
}
}
void OnGiveXP(Player* player, uint32& amount, Unit* /*victim*/, uint8 /*xpSource*/) override
void OnGiveXP(Player* player, uint32& amount, Unit* /*victim*/, uint8 xpSource) override
{
if (!sIndividualProgression->enabled)
{
@@ -139,11 +139,19 @@ public:
// Player is still in Vanilla content - do not give XP past level 60
if (!sIndividualProgression->hasPassedProgression(player, PROGRESSION_NAXX40) && player->getLevel() >= 60)
{
// Still award XP to pets - they won't be able to pass the player's level
Pet* pet = player->GetPet();
if (pet && xpSource == XPSOURCE_KILL)
pet->GivePetXP(player->GetGroup() ? amount / 2 : amount);
amount = 0;
}
// Player is in TBC content - do not give XP past level 70
else if (!sIndividualProgression->hasPassedProgression(player, PROGRESSION_TBC_TIER_5) && player->getLevel() >= 70)
{
// Still award XP to pets - they won't be able to pass the player's level
Pet* pet = player->GetPet();
if (pet && xpSource == XPSOURCE_KILL)
pet->GivePetXP(player->GetGroup() ? amount / 2 : amount);
amount = 0;
}
}