fix(Core/Pets): Mob "soloed" by pet should not grant exp/loot to its … (#11969)

* fix(Core/Pets): Mob "soloed" by pet should not grant exp/loot to its master.

Fixes #11528
This commit is contained in:
UltraNix
2022-06-19 13:46:23 +02:00
committed by GitHub
parent 82cfd1b8d4
commit a935e51754
4 changed files with 45 additions and 16 deletions

View File

@@ -124,9 +124,9 @@ uint32 Acore::XP::Gain(Player* player, Unit* unit, bool isBattleGround /*= false
}
// if players dealt less than 50% of the damage and were credited anyway (due to CREATURE_FLAG_EXTRA_NO_PLAYER_DAMAGE_REQ), scale XP gained appropriately (linear scaling)
if (creature && creature->m_PlayerDamageReq)
if (creature && creature->GetPlayerDamageReq())
{
xpMod *= 1.0f - 2.0f * creature->m_PlayerDamageReq / creature->GetMaxHealth();
xpMod *= 1.0f - 2.0f * creature->GetPlayerDamageReq() / creature->GetMaxHealth();
}
gain = uint32(gain * xpMod);