*Call Reset() only if the npc is alive.

*I hope this fix some issues in instances. Eg.: GetData() give the correct value.
*Thanks to megamage for the help.

--HG--
branch : trunk
This commit is contained in:
Anubisss
2009-07-23 22:51:56 +02:00
parent 8b25691541
commit 89a8ebd53a

View File

@@ -23,6 +23,7 @@
#include "Platform/Define.h"
#include <list>
#include "Unit.h"
class Unit;
class Player;
@@ -47,7 +48,7 @@ class TRINITY_DLL_SPEC UnitAI
virtual void AttackStart(Unit *);
virtual void UpdateAI(const uint32 diff) = 0;
virtual void InitializeAI() { Reset(); }
virtual void InitializeAI() { if(!me->isDead()) Reset(); }
virtual void Reset() {};