Core/Creature: fixed loading of creature auras on respawn, deathState needs to be set to ALIVE before trying to AddAuras (which fails with different deathState than ALIVE)

Closes https://github.com/TrinityCore/TrinityCore/issues/4150

(cherry picked from commit 530074f453)
This commit is contained in:
MitchesD
2015-06-21 13:40:24 +02:00
parent 20e3da1e5b
commit a35ec4c35a

View File

@@ -1507,11 +1507,11 @@ void Creature::setDeathState(DeathState s)
SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npcflag);
ClearUnitState(uint32(UNIT_STATE_ALL_STATE & ~UNIT_STATE_IGNORE_PATHFINDING));
SetMeleeDamageSchool(SpellSchools(cinfo->dmgschool));
LoadCreaturesAddon(true);
Motion_Initialize();
if (GetCreatureData() && GetPhaseMask() != GetCreatureData()->phaseMask)
SetPhaseMask(GetCreatureData()->phaseMask, false);
Unit::setDeathState(ALIVE);
LoadCreaturesAddon(true);
}
}