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
@@ -203,8 +203,11 @@ public:
summons.DespawnAll(); summons.DespawnAll();
Talk(SAY_DEATH); Talk(SAY_DEATH);
if (GameObject* go = me->GetMap()->GetGameObject(pInstance->GetData64(DATA_KELTHUZAD_GATE))) if (pInstance)
go->SetGoState(GO_STATE_ACTIVE); {
if (GameObject* go = me->GetMap()->GetGameObject(pInstance->GetData64(DATA_KELTHUZAD_GATE)))
go->SetGoState(GO_STATE_ACTIVE);
}
} }
void MoveInLineOfSight(Unit* who) void MoveInLineOfSight(Unit* who)
@@ -80,8 +80,12 @@ public:
BossAI::Reset(); BossAI::Reset();
events.Reset(); events.Reset();
summons.DespawnAll(); 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);
}
} }