From 410d3cd8e89cbe36a3f0e73f122165bead9dbb5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E4=BD=A9=E8=8C=B9?= Date: Fri, 7 Jul 2023 10:57:20 -0600 Subject: [PATCH] Fix Hunter pet XP at progression level caps --- src/IndividualProgressionPlayer.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/IndividualProgressionPlayer.cpp b/src/IndividualProgressionPlayer.cpp index fd2a746..783cee7 100644 --- a/src/IndividualProgressionPlayer.cpp +++ b/src/IndividualProgressionPlayer.cpp @@ -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; } }