mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-29 00:23:48 +00:00
fix(Core/Creature): Fix kill credit for some mobs after UpdateEntry (#5746)
Co-authored-by: Yehonal <yehonal.azeroth@gmail.com
This commit is contained in:
@@ -454,13 +454,22 @@ bool Creature::UpdateEntry(uint32 Entry, const CreatureData* data, bool changele
|
||||
SetAttackTime(RANGED_ATTACK, cInfo->RangeAttackTime);
|
||||
|
||||
uint32 previousHealth = GetHealth();
|
||||
uint32 previousMaxHealth = GetMaxHealth();
|
||||
uint32 previousPlayerDamageReq = m_PlayerDamageReq;
|
||||
|
||||
SelectLevel(changelevel);
|
||||
if (previousHealth > 0)
|
||||
{
|
||||
SetHealth(previousHealth);
|
||||
m_PlayerDamageReq = previousPlayerDamageReq;
|
||||
|
||||
if (previousMaxHealth && previousMaxHealth > GetMaxHealth())
|
||||
{
|
||||
m_PlayerDamageReq = (uint32)(previousPlayerDamageReq * GetMaxHealth() / previousMaxHealth);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_PlayerDamageReq = previousPlayerDamageReq;
|
||||
}
|
||||
}
|
||||
|
||||
SetMeleeDamageSchool(SpellSchools(cInfo->dmgschool));
|
||||
|
||||
Reference in New Issue
Block a user