From e4e048ed570e7723f6e9a38c9f5ba37f53811a21 Mon Sep 17 00:00:00 2001 From: Shauren Date: Wed, 8 Dec 2010 17:24:31 +0100 Subject: Core/Scripts: Fixed possible crashes in instance scripts (Icecrown Citadel and Naxxramas) Scripts/Sunwell Plateau: Fixed crash in Kil'jaeden Scripts/Icecrown Citadel: Fixed crash in Blood-Queen Lana'thel Closes issue #5051. Closes issue #5050. Closes issue #5035. --HG-- branch : trunk --- .../EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/server/scripts/EasternKingdoms') diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp index b89824b819b..05fd6881d85 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp @@ -724,8 +724,9 @@ public: if (Speeches[speechCount].timer < SpeechTimer) { SpeechTimer = 0; - if (Creature* pSpeechCreature = Unit::GetCreature(*me, pInstance->GetData64(Speeches[speechCount].pCreature))) - DoScriptText(Speeches[speechCount].textid, pSpeechCreature); + if (pInstance) + if (Creature* pSpeechCreature = Unit::GetCreature(*me, pInstance->GetData64(Speeches[speechCount].pCreature))) + DoScriptText(Speeches[speechCount].textid, pSpeechCreature); if (speechCount == 12) if (Creature* pAnveena = Unit::GetCreature(*me, pInstance->GetData64(DATA_ANVEENA))) pAnveena->CastSpell(me, SPELL_SACRIFICE_OF_ANVEENA, false); @@ -826,18 +827,19 @@ public: } break; case TIMER_ORBS_EMPOWER: //Phase 3 - if (Creature* pKalec = Unit::GetCreature(*me, pInstance->GetData64(DATA_KALECGOS_KJ))) - { - switch (Phase) + if (pInstance) + if (Creature* pKalec = Unit::GetCreature(*me, pInstance->GetData64(DATA_KALECGOS_KJ))) { + switch (Phase) + { case PHASE_SACRIFICE: CAST_AI(boss_kalecgos_kj::boss_kalecgos_kjAI, pKalec->AI())->EmpowerOrb(true); break; default: CAST_AI(boss_kalecgos_kj::boss_kalecgos_kjAI, pKalec->AI())->EmpowerOrb(false); break; + } } - } OrbActivated = true; TimerIsDeactivated[TIMER_ORBS_EMPOWER] = true; break; -- cgit v1.2.3