Core/Scripts: Fixed script unloading

This commit is contained in:
Shauren
2012-03-24 17:09:42 +01:00
parent c058e6740b
commit 78e8de5913
2 changed files with 10 additions and 6 deletions

View File

@@ -260,7 +260,7 @@ void ScriptMgr::Initialize()
void ScriptMgr::Unload()
{
#define SCR_CLEAR(T) \
FOR_SCRIPTS(T, itr, end) \
for (SCR_REG_ITR(T) itr = SCR_REG_LST(T).begin(); itr != SCR_REG_LST(T).end(); ++itr) \
delete itr->second; \
SCR_REG_LST(T).clear();

View File

@@ -444,18 +444,22 @@ public:
void Reset()
{
Say_Timer = 5000;
ReleasedFromCage = false;
}
void UpdateAI(uint32 const diff)
{
if (Say_Timer <= diff && ReleasedFromCage)
if (ReleasedFromCage)
{
me->ForcedDespawn();
ReleasedFromCage = false;
if (Say_Timer <= diff)
{
me->ForcedDespawn();
ReleasedFromCage = false;
}
else
Say_Timer -= diff;
}
else
Say_Timer -= diff;
}
void MovementInform(uint32 type, uint32 id)