mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 02:50:29 +00:00
fix(Core/DungeonFinder): Dead players should be able to get XP reward from random dungeon. (#9319)
Fixes #9082
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user