Fixes issue #214 : infinite loop in Maiden of Grief script

--HG--
branch : trunk
This commit is contained in:
Trazom62
2010-01-15 18:16:33 +01:00
parent e3edc52a2d
commit b8ea34958c
2 changed files with 14 additions and 6 deletions

View File

@@ -63,12 +63,7 @@ struct TRINITY_DLL_DECL boss_maiden_of_griefAI : public ScriptedAI
AchievTimer = 0;
if (pInstance)
{
pInstance->SetData(DATA_MAIDEN_OF_GRIEF_EVENT, NOT_STARTED);
if (GameObject *pDoor = pInstance->instance->GetGameObject(pInstance->GetData64(DATA_MAIDEN_DOOR)))
if (pDoor->GetGoState() == GO_STATE_READY)
EnterEvadeMode();
}
}
void EnterCombat(Unit* who)
@@ -76,7 +71,16 @@ struct TRINITY_DLL_DECL boss_maiden_of_griefAI : public ScriptedAI
DoScriptText(SAY_AGGRO, m_creature);
if (pInstance)
{
if (GameObject *pDoor = pInstance->instance->GetGameObject(pInstance->GetData64(DATA_MAIDEN_DOOR)))
if (pDoor->GetGoState() == GO_STATE_READY)
{
EnterEvadeMode();
return;
}
pInstance->SetData(DATA_MAIDEN_OF_GRIEF_EVENT, IN_PROGRESS);
}
}
void UpdateAI(const uint32 diff)

View File

@@ -114,10 +114,14 @@ struct TRINITY_DLL_DECL boss_sjonnirAI : public ScriptedAI
if (pInstance)
{
pInstance->SetData(DATA_SJONNIR_EVENT, IN_PROGRESS);
if (GameObject *pDoor = pInstance->instance->GetGameObject(pInstance->GetData64(DATA_SJONNIR_DOOR)))
if (pDoor->GetGoState() == GO_STATE_READY)
{
EnterEvadeMode();
return;
}
pInstance->SetData(DATA_SJONNIR_EVENT, IN_PROGRESS);
}
}