mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +01:00
*Fix a crash caused by gothik. Thanks to new001.
--HG-- branch : trunk
This commit is contained in:
@@ -106,8 +106,8 @@ struct TRINITY_DLL_DECL boss_gothikAI : public BossAI
|
||||
boss_gothikAI(Creature *c) : BossAI(c, BOSS_GOTHIK) {}
|
||||
|
||||
uint32 waveCount;
|
||||
std::vector<Creature*> liveTrigger;
|
||||
std::vector<Creature*> deadTrigger;
|
||||
typedef std::vector<Creature*> TriggerVct;
|
||||
TriggerVct liveTrigger, deadTrigger;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
@@ -156,6 +156,20 @@ struct TRINITY_DLL_DECL boss_gothikAI : public BossAI
|
||||
summons.Summon(summon);
|
||||
}
|
||||
|
||||
void SummonedCreatureDespawn(Creature *summon)
|
||||
{
|
||||
if (summon->GetEntry() == WORLD_TRIGGER)
|
||||
{
|
||||
//for(TriggerVct::iterator itr = liveTrigger.begin(); itr != liveTrigger.end(); ++itr)
|
||||
// if(*itr == summon)
|
||||
error_log("boss_gothikAI: trigger is despawned!");
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
}
|
||||
|
||||
summons.Despawn(summon);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (!(rand()%5))
|
||||
@@ -164,6 +178,8 @@ struct TRINITY_DLL_DECL boss_gothikAI : public BossAI
|
||||
|
||||
void JustDied(Unit* Killer)
|
||||
{
|
||||
liveTrigger.clear();
|
||||
deadTrigger.clear();
|
||||
_JustDied();
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user