fixed crash issue is creatures are summoned outside of the instance

This commit is contained in:
talamortis
2018-03-18 22:41:29 +00:00
parent f329d17083
commit 13580238c4
2 changed files with 11 additions and 4 deletions

View File

@@ -203,8 +203,11 @@ public:
summons.DespawnAll();
Talk(SAY_DEATH);
if (GameObject* go = me->GetMap()->GetGameObject(pInstance->GetData64(DATA_KELTHUZAD_GATE)))
go->SetGoState(GO_STATE_ACTIVE);
if (pInstance)
{
if (GameObject* go = me->GetMap()->GetGameObject(pInstance->GetData64(DATA_KELTHUZAD_GATE)))
go->SetGoState(GO_STATE_ACTIVE);
}
}
void MoveInLineOfSight(Unit* who)

View File

@@ -80,8 +80,12 @@ public:
BossAI::Reset();
events.Reset();
summons.DespawnAll();
if (GameObject* go = me->GetMap()->GetGameObject(pInstance->GetData64(DATA_MAEXXNA_GATE)))
go->SetGoState(GO_STATE_ACTIVE);
if (pInstance)
{
if (GameObject* go = me->GetMap()->GetGameObject(pInstance->GetData64(DATA_MAEXXNA_GATE)))
go->SetGoState(GO_STATE_ACTIVE);
}
}