Core/Spells: Allow periodic trigger auras to work on dead creatures. Patch by Josh (major stuff) and me (minor changes).

This commit is contained in:
QAston
2011-07-12 00:19:50 +02:00
parent 58c63f4cc5
commit 53cc218983

View File

@@ -233,6 +233,7 @@ void Creature::RemoveCorpse(bool setSpawnTime)
m_corpseRemoveTime = time(NULL);
setDeathState(DEAD);
RemoveAllAuras();
UpdateObjectVisibility();
loot.clear();
uint32 respawnDelay = m_respawnDelay;
@@ -470,11 +471,15 @@ void Creature::Update(uint32 diff)
}
case CORPSE:
{
m_Events.Update(diff);
_UpdateSpells(diff);
// deathstate changed on spells update, prevent problems
if (m_deathState != CORPSE)
break;
if (m_groupLootTimer && lootingGroupLowGUID)
{
// for delayed spells
m_Events.Update(diff);
if (m_groupLootTimer <= diff)
{
Group* group = sGroupMgr->GetGroupByGUID(lootingGroupLowGUID);
@@ -490,12 +495,6 @@ void Creature::Update(uint32 diff)
RemoveCorpse(false);
sLog->outStaticDebug("Removing corpse... %u ", GetUInt32Value(OBJECT_FIELD_ENTRY));
}
else
{
// for delayed spells
m_Events.Update(diff);
}
break;
}
case ALIVE: