Core/Creature: Do not reward XP for creatures without any loot recipient. (XP fix part for the "pet-only"-kills)

--HG--
branch : trunk
This commit is contained in:
linencloth
2010-09-15 17:37:03 +02:00
parent 91d2c1d64c
commit 52bc2478c9
@@ -2639,6 +2639,9 @@ void Player::GiveXP(uint32 xp, Unit *victim, float group_rate)
if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN)) if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN))
return; return;
if (victim && victim->GetTypeId() == TYPEID_UNIT && !victim->ToCreature()->hasLootRecipient())
return;
uint8 level = getLevel(); uint8 level = getLevel();
sScriptMgr.OnGivePlayerXP(this, xp, victim); sScriptMgr.OnGivePlayerXP(this, xp, victim);