feat(Core): improved some hooks (#6302)

This commit is contained in:
Yehonal
2021-06-13 10:23:24 +02:00
committed by GitHub
parent 806dc4052f
commit baf437bb98
43 changed files with 162 additions and 93 deletions

View File

@@ -3304,6 +3304,13 @@ void Player::GiveXP(uint32 xp, Unit* victim, float group_rate)
else
bonus_xp = victim ? GetXPRestBonus(xp) : 0; // XP resting bonus
// hooks and multipliers can modify the xp with a zero or negative value
// check again before sending invalid xp to the client
if (xp < 1)
{
return;
}
SendLogXPGain(xp, victim, bonus_xp, recruitAFriend, group_rate);
uint32 curXP = GetUInt32Value(PLAYER_XP);