fix(Core/DungeonFinder): Dead players should be able to get XP reward from random dungeon. (#9319)

Fixes #9082
This commit is contained in:
UltraNix
2021-12-01 11:04:41 +01:00
committed by GitHub
parent fc4b5a93a0
commit 8668a03e14
4 changed files with 16 additions and 8 deletions

View File

@@ -2295,19 +2295,27 @@ void Player::SendLogXPGain(uint32 GivenXP, Unit* victim, uint32 BonusXP, bool re
GetSession()->SendPacket(&data);
}
void Player::GiveXP(uint32 xp, Unit* victim, float group_rate)
void Player::GiveXP(uint32 xp, Unit* victim, float group_rate, bool isLFGReward)
{
if (xp < 1)
{
return;
}
if (!IsAlive() && !GetBattlegroundId())
if (!IsAlive() && !GetBattlegroundId() && !isLFGReward)
{
return;
}
if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN))
{
return;
}
if (victim && victim->GetTypeId() == TYPEID_UNIT && !victim->ToCreature()->hasLootRecipient())
{
return;
}
uint8 level = getLevel();