Core/SAI: do not pass old creatureData to UpdateEntry() and keep current health when changing a NPC's entry. (#23493)

(cherry picked from commit 8967cc96df4c1c5c7465e9fd1fa66400f3e992b3)
This commit is contained in:
Wyrserth
2021-12-13 00:42:17 +01:00
committed by Shauren
parent adc16ffbdc
commit 62f5d9b46b
2 changed files with 6 additions and 1 deletions
@@ -1058,7 +1058,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
for (WorldObject* target : targets)
if (IsCreature(target))
target->ToCreature()->UpdateEntry(e.action.updateTemplate.creature, target->ToCreature()->GetCreatureData(), e.action.updateTemplate.updateLevel != 0);
target->ToCreature()->UpdateEntry(e.action.updateTemplate.creature, nullptr, e.action.updateTemplate.updateLevel != 0);
break;
}
case SMART_ACTION_DIE: