aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-05-16 22:45:13 -0500
committermegamage <none@none>2009-05-16 22:45:13 -0500
commit698b43f088b0c51dc9921d46ff915dae2d793503 (patch)
tree434fde0a2b1944ddba7b490b059dce7c40901653 /src
parentc583767ad681dfe006fbdcfe9768f096d19c347f (diff)
*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
Diffstat (limited to 'src')
-rw-r--r--src/bindings/scripts/include/sc_creature.cpp9
1 files changed, 6 insertions, 3 deletions
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)