fix(Core/SAI): Do not reset HP with SMART_ACTION_UPDATE_ENTRY (#4486)
Co-Authored-By: Wyrserth <43747507+Wyrserth@users.noreply.github.com>
This commit is contained in:
@@ -1304,7 +1304,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
|||||||
|
|
||||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||||
if (IsCreature(*itr))
|
if (IsCreature(*itr))
|
||||||
(*itr)->ToCreature()->UpdateEntry(e.action.updateTemplate.creature, NULL, e.action.updateTemplate.updateLevel != 0);
|
(*itr)->ToCreature()->UpdateEntry(e.action.updateTemplate.creature, nullptr, e.action.updateTemplate.updateLevel != 0);
|
||||||
|
|
||||||
delete targets;
|
delete targets;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -434,7 +434,12 @@ bool Creature::UpdateEntry(uint32 Entry, const CreatureData* data, bool changele
|
|||||||
SetAttackTime(OFF_ATTACK, cInfo->BaseAttackTime);
|
SetAttackTime(OFF_ATTACK, cInfo->BaseAttackTime);
|
||||||
SetAttackTime(RANGED_ATTACK, cInfo->RangeAttackTime);
|
SetAttackTime(RANGED_ATTACK, cInfo->RangeAttackTime);
|
||||||
|
|
||||||
|
uint32 previousHealth = GetHealth();
|
||||||
SelectLevel(changelevel);
|
SelectLevel(changelevel);
|
||||||
|
if (previousHealth > 0)
|
||||||
|
{
|
||||||
|
SetHealth(previousHealth);
|
||||||
|
}
|
||||||
|
|
||||||
SetMeleeDamageSchool(SpellSchools(cInfo->dmgschool));
|
SetMeleeDamageSchool(SpellSchools(cInfo->dmgschool));
|
||||||
CreatureBaseStats const* stats = sObjectMgr->GetCreatureBaseStats(getLevel(), cInfo->unit_class);
|
CreatureBaseStats const* stats = sObjectMgr->GetCreatureBaseStats(getLevel(), cInfo->unit_class);
|
||||||
|
|||||||
Reference in New Issue
Block a user