From 7e52b1120c41f9ccaf82b2ca67021e97b35e8b9e Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Fri, 21 Aug 2009 17:15:35 +0200 Subject: *Fix crash in mob_anti_airAI. Remove assert and cast no spell instead, if no spell was found in DB template. --HG-- branch : trunk --- .../eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/bindings/scripts') diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp index b13423e850f..3a1f7304688 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp @@ -104,11 +104,16 @@ struct TRINITY_DLL_DECL mob_anti_airAI : public ScriptedAI { mob_anti_airAI(Creature *c) : ScriptedAI(c) { - assert(me->m_spells[0]); + if(!me->m_spells[0]) + spell = NULL; + else + spell = me->m_spells[0]; + range = DoGetSpellMaxRange(me->m_spells[0]); } float range; + uint32 spell; void MoveInLineOfSight(Unit *who) { @@ -136,7 +141,7 @@ struct TRINITY_DLL_DECL mob_anti_airAI : public ScriptedAI if(me->getVictim()->IsFlying() || !me->IsWithinMeleeRange(me->getVictim())) { - if(!DoSpellAttackIfReady(me->m_spells[0])) + if(!DoSpellAttackIfReady(spell)) EnterEvadeMode(); } else -- cgit v1.2.3