diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index ad2308ab8..cef57906e 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -331,6 +331,15 @@ void Creature::Update(uint32 diff) break; case DEAD: { + if (isSpiritService()) + { + Unit::Update( diff ); + // do not allow the AI to be changed during update + m_AI_locked = true; + i_AI->UpdateAI(diff); + m_AI_locked = false; + break; // they don't should respawn + } if( m_respawnTime <= time(NULL) ) { DEBUG_LOG("Respawning..."); @@ -1533,12 +1542,15 @@ void Creature::setDeathState(DeathState s) { SetHealth(GetMaxHealth()); SetLootRecipient(NULL); - Unit::setDeathState(ALIVE); CreatureInfo const *cinfo = GetCreatureInfo(); SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0); RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); AddMonsterMoveFlag(MONSTER_MOVE_WALK); SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npcflag); + if (!isSpiritService()) + Unit::setDeathState(ALIVE); + else + Unit::setDeathState(DEAD); clearUnitState(UNIT_STAT_ALL_STATE); i_motionMaster.Clear(); SetMeleeDamageSchool(SpellSchools(cinfo->dmgschool)); diff --git a/src/game/GridNotifiersImpl.h b/src/game/GridNotifiersImpl.h index 8d2433ce3..151b4e0c3 100644 --- a/src/game/GridNotifiersImpl.h +++ b/src/game/GridNotifiersImpl.h @@ -44,8 +44,7 @@ inline void MaNGOS::ObjectUpdater::Visit(CreatureMapType &m) { for(CreatureMapType::iterator iter=m.begin(); iter != m.end(); ++iter) - if(!iter->getSource()->isSpiritService()) - iter->getSource()->Update(i_timeDiff); + iter->getSource()->Update(i_timeDiff); } inline void diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index b1b98db0b..2deeecb64 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8549" + #define REVISION_NR "8550" #endif // __REVISION_NR_H__