From 698b43f088b0c51dc9921d46ff915dae2d793503 Mon Sep 17 00:00:00 2001 From: megamage Date: Sat, 16 May 2009 22:45:13 -0500 Subject: *Make some boss scripts safer. But I still strongly recommend that you do not spawn instance bosses outside the instance. They may make server crash like hell. --HG-- branch : trunk --- src/bindings/scripts/include/sc_creature.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/bindings/scripts/include/sc_creature.cpp b/src/bindings/scripts/include/sc_creature.cpp index e575e40fac1..c1edc567457 100644 --- a/src/bindings/scripts/include/sc_creature.cpp +++ b/src/bindings/scripts/include/sc_creature.cpp @@ -654,20 +654,23 @@ void BossAI::_Reset() { events.Reset(); summons.DespawnAll(); - instance->SetBossState(bossId, NOT_STARTED); + if(instance) + instance->SetBossState(bossId, NOT_STARTED); } void BossAI::_JustDied() { events.Reset(); summons.DespawnAll(); - instance->SetBossState(bossId, DONE); + if(instance) + instance->SetBossState(bossId, DONE); } void BossAI::_EnterCombat() { DoZoneInCombat(); - instance->SetBossState(bossId, IN_PROGRESS); + if(instance) + instance->SetBossState(bossId, IN_PROGRESS); } void BossAI::JustSummoned(Creature *summon) -- cgit v1.2.3