From 9143f19befc180d7e6e4aca24f104b9e6b12f8f5 Mon Sep 17 00:00:00 2001 From: balrok Date: Mon, 21 Sep 2009 19:27:29 +0200 Subject: [PATCH] [8550] call Unit::Update() also for spiritguides cause they are dead i had to add another hack :-/ --- src/game/Creature.cpp | 14 +++++++++++++- src/game/GridNotifiersImpl.h | 3 +-- src/shared/revision_nr.h | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) 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__