Fix crash in Gluth Script.

Fixes issue #1896.

--HG--
branch : trunk
This commit is contained in:
Trazom62
2010-05-02 15:17:30 +02:00
parent 9664034eea
commit 5ebee9fbd0

View File

@@ -52,14 +52,6 @@ struct boss_gluthAI : public BossAI
me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_INFECTED_WOUND, true);
}
std::vector<Creature*> triggers;
void Reset()
{
triggers.clear();
_Reset();
}
void MoveInLineOfSight(Unit *who)
{
if (who->GetEntry() == MOB_ZOMBIE && me->IsWithinDistInMap(who, 7))
@@ -74,16 +66,6 @@ struct boss_gluthAI : public BossAI
void EnterCombat(Unit * /*who*/)
{
for (uint32 i = 0; i < 3; ++i)
if (Creature *trigger = DoSummon(WORLD_TRIGGER, PosSummon[i]))
triggers.push_back(trigger);
if (triggers.size() < 3)
{
error_log("Script Gluth: cannot summon triggers!");
EnterEvadeMode();
return;
}
_EnterCombat();
events.ScheduleEvent(EVENT_WOUND, 10000);
events.ScheduleEvent(EVENT_ENRAGE, 15000);
@@ -94,9 +76,7 @@ struct boss_gluthAI : public BossAI
void JustSummoned(Creature *summon)
{
if (summon->GetEntry() == WORLD_TRIGGER)
summon->setActive(true);
else if (summon->GetEntry() == MOB_ZOMBIE)
if (summon->GetEntry() == MOB_ZOMBIE)
summon->AI()->AttackStart(me);
summons.Summon(summon);
}
@@ -132,7 +112,7 @@ struct boss_gluthAI : public BossAI
break;
case EVENT_SUMMON:
for (uint32 i = 0; i < RAID_MODE(1,2); ++i)
DoSummon(MOB_ZOMBIE, triggers[rand()%3]);
DoSummon(MOB_ZOMBIE, PosSummon[rand()%3]);
events.ScheduleEvent(EVENT_SUMMON, 10000);
break;
}