mirror of
https://github.com/ZhengPeiRu21/mod-individual-progression
synced 2025-11-29 23:44:51 +08:00
Fix Hunter pet XP at progression level caps
This commit is contained in:
@@ -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)
|
if (!sIndividualProgression->enabled)
|
||||||
{
|
{
|
||||||
@@ -139,11 +139,19 @@ public:
|
|||||||
// Player is still in Vanilla content - do not give XP past level 60
|
// Player is still in Vanilla content - do not give XP past level 60
|
||||||
if (!sIndividualProgression->hasPassedProgression(player, PROGRESSION_NAXX40) && player->getLevel() >= 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;
|
amount = 0;
|
||||||
}
|
}
|
||||||
// Player is in TBC content - do not give XP past level 70
|
// Player is in TBC content - do not give XP past level 70
|
||||||
else if (!sIndividualProgression->hasPassedProgression(player, PROGRESSION_TBC_TIER_5) && player->getLevel() >= 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;
|
amount = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user