aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/CoreAI/CombatAI.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp2
-rw-r--r--src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp9
-rw-r--r--src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp3
-rw-r--r--src/server/scripts/Kalimdor/zone_tanaris.cpp2
-rw-r--r--src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp13
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp5
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_illidan.cpp2
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp2
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp3
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp2
-rw-r--r--src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp4
-rw-r--r--src/server/scripts/Pet/pet_hunter.cpp2
15 files changed, 34 insertions, 23 deletions
diff --git a/src/server/game/AI/CoreAI/CombatAI.cpp b/src/server/game/AI/CoreAI/CombatAI.cpp
index 32b229a5ea8..27144728a3e 100644
--- a/src/server/game/AI/CoreAI/CombatAI.cpp
+++ b/src/server/game/AI/CoreAI/CombatAI.cpp
@@ -151,7 +151,7 @@ void CasterAI::UpdateAI(uint32 diff)
events.Update(diff);
- if (me->EnsureVictim()->HasBreakableByDamageCrowdControlAura(me))
+ if (me->GetVictim() && me->EnsureVictim()->HasBreakableByDamageCrowdControlAura(me))
{
me->InterruptNonMeleeSpells(false);
return;
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
index 209154ec5f9..92cdb40dc7b 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
@@ -391,7 +391,7 @@ public:
if (me->HasUnitState(UNIT_STATE_STUNNED)) // While shifting to phase 2 malchezaar stuns himself
return;
- if (me->GetUInt64Value(UNIT_FIELD_TARGET) != me->EnsureVictim()->GetGUID())
+ if (me->GetVictim() && me->GetUInt64Value(UNIT_FIELD_TARGET) != me->EnsureVictim()->GetGUID())
me->SetTarget(me->EnsureVictim()->GetGUID());
if (phase == 1)
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
index 1bba7f02828..c6f97c12267 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
@@ -484,7 +484,7 @@ public:
EnterEvadeMode();
return;
}
- else if (me->EnsureVictim()->GetTypeId() == TYPEID_PLAYER && me->EnsureVictim()->HealthBelowPct(10))
+ else if (me->GetVictim() && me->EnsureVictim()->GetTypeId() == TYPEID_PLAYER && me->EnsureVictim()->HealthBelowPct(10))
{
me->EnsureVictim()->CastSpell(me->GetVictim(), 7267, true); // beg
me->EnsureVictim()->RemoveGameObject(SPELL_DUEL_FLAG, true);
@@ -832,7 +832,7 @@ public:
}
}
- if (!UpdateVictim())
+ if (!UpdateVictim() || !me->GetVictim())
return;
//ScriptedAI::UpdateAI(diff);
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp
index a03455f6213..b57ffa7bc9c 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp
@@ -298,7 +298,7 @@ public:
Unit* target = (*itr)->getTarget();
if (target
&& target->GetTypeId() == TYPEID_PLAYER
- && target->GetGUID() != me->EnsureVictim()->GetGUID()
+ && (!target->GetVictim() || target->GetGUID() != me->EnsureVictim()->GetGUID())
&& target->GetPositionZ() > me->GetPositionZ() - 5
&& !target->HasAura(AURA_SPECTRAL_EXHAUSTION))
{
diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp
index 0af42f5af20..04e5f031589 100644
--- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp
+++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp
@@ -156,9 +156,12 @@ class boss_ayamiss : public CreatureScript
_phase = PHASE_GROUND;
SetCombatMovement(true);
me->SetCanFly(false);
- Position VictimPos;
- me->EnsureVictim()->GetPosition(&VictimPos);
- me->GetMotionMaster()->MovePoint(POINT_GROUND, VictimPos);
+ if (me->GetVictim())
+ {
+ Position VictimPos;
+ me->EnsureVictim()->GetPosition(&VictimPos);
+ me->GetMotionMaster()->MovePoint(POINT_GROUND, VictimPos);
+ }
DoResetThreat();
events.ScheduleEvent(EVENT_LASH, urand(5000, 8000));
events.ScheduleEvent(EVENT_TRASH, urand(3000, 6000));
diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp
index 7038dd0df46..20100dfc5dd 100644
--- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp
+++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp
@@ -272,7 +272,8 @@ class npc_glob_of_viscidus : public CreatureScript
if (Viscidus->IsAlive() && Viscidus->GetHealthPct() < 5.0f)
{
Viscidus->SetVisible(true);
- Viscidus->EnsureVictim()->Kill(Viscidus);
+ if (Viscidus->GetVictim())
+ Viscidus->EnsureVictim()->Kill(Viscidus);
}
else
{
diff --git a/src/server/scripts/Kalimdor/zone_tanaris.cpp b/src/server/scripts/Kalimdor/zone_tanaris.cpp
index d73c73cc2fa..1e1c3a3fc3c 100644
--- a/src/server/scripts/Kalimdor/zone_tanaris.cpp
+++ b/src/server/scripts/Kalimdor/zone_tanaris.cpp
@@ -120,7 +120,7 @@ public:
{
if (SendItemTimer <= diff)
{
- if (me->EnsureVictim()->GetTypeId() == TYPEID_PLAYER)
+ if (me->GetVictim() && me->EnsureVictim()->GetTypeId() == TYPEID_PLAYER)
SendItem(me->GetVictim());
SendItemTimer = 5000;
} else SendItemTimer -= diff;
diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp
index 2803cccead3..0a2ebb549f8 100644
--- a/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp
+++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp
@@ -230,11 +230,14 @@ class boss_urom : public CreatureScript
{
if (arcaneExplosionTimer <= diff)
{
- Position pos;
- me->EnsureVictim()->GetPosition(&pos);
-
- me->NearTeleportTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation());
- me->GetMotionMaster()->MoveChase(me->GetVictim());
+ if (me->GetVictim())
+ {
+ Position pos;
+ me->EnsureVictim()->GetPosition(&pos);
+
+ me->NearTeleportTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation());
+ me->GetMotionMaster()->MoveChase(me->GetVictim());
+ }
me->SetWalk(true);
Talk(EMOTE_ARCANE_EXPLOSION);
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp
index c199fe9e9e3..ce6e99401a5 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp
@@ -199,7 +199,10 @@ class npc_flash_freeze : public CreatureScript
void UpdateAI(uint32 diff) OVERRIDE
{
- if (!UpdateVictim() || me->EnsureVictim()->HasAura(SPELL_BLOCK_OF_ICE) || me->EnsureVictim()->HasAura(SPELL_FLASH_FREEZE_HELPER))
+ if (!UpdateVictim()
+ || !me->GetVictim()
+ || me->EnsureVictim()->HasAura(SPELL_BLOCK_OF_ICE)
+ || me->EnsureVictim()->HasAura(SPELL_FLASH_FREEZE_HELPER))
return;
if (me->EnsureVictim()->GetGUID() != targetGUID || instance->GetBossState(BOSS_HODIR) != IN_PROGRESS)
diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
index 957471216d8..b3d59c390c0 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
@@ -2074,7 +2074,7 @@ public:
void UpdateAI(uint32 /*diff*/) OVERRIDE
{
- if (!UpdateVictim())
+ if (!UpdateVictim() || !me->GetVictim())
return;
if (me->EnsureVictim()->GetTypeId() != TYPEID_PLAYER)
diff --git a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp
index d86d94088da..ed742a56ecd 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp
@@ -668,7 +668,7 @@ public:
void UpdateAI(uint32 diff) OVERRIDE
{
//Return since we have no target
- if (!UpdateVictim())
+ if (!UpdateVictim() || !me->GetVictim())
return;
if (!CheckedAggro)
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp
index 490bfaa16fc..3cb9ca26599 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp
@@ -626,7 +626,8 @@ public:
{
DoCastVictim(SPELL_TIDAL_SURGE);
// Hacky way to do it - won't trigger elseways
- me->EnsureVictim()->CastSpell(me->GetVictim(), SPELL_TIDAL_SURGE_FREEZE, true);
+ if (me->GetVictim())
+ me->EnsureVictim()->CastSpell(me->GetVictim(), SPELL_TIDAL_SURGE_FREEZE, true);
TidalSurge_Timer = 15000+rand()%5000;
} else TidalSurge_Timer -= diff;
diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp
index 73da4f62a23..4df431b91ac 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp
@@ -135,7 +135,7 @@ public:
void UpdateAI(uint32 diff) OVERRIDE
{
//Return since we have no target
- if (!UpdateVictim())
+ if (!UpdateVictim() || !me->GetVictim())
return;
if (me->EnsureVictim()->GetGUID() != victimGUID)
diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp
index 500bcd1ed8f..78a7d71732a 100644
--- a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp
+++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp
@@ -93,7 +93,7 @@ class npc_warp_splinter_treant : public CreatureScript
void UpdateAI(uint32 diff) OVERRIDE
{
- if (!UpdateVictim())
+ if (!UpdateVictim() || !me->GetVictim())
{
if (WarpGuid && check_Timer <= diff)
{
@@ -115,7 +115,7 @@ class npc_warp_splinter_treant : public CreatureScript
return;
}
- if (me->EnsureVictim()->GetGUID() != WarpGuid)
+ if (me->EnsureVictim()->GetGUID() != WarpGuid)
DoMeleeAttackIfReady();
}
};
diff --git a/src/server/scripts/Pet/pet_hunter.cpp b/src/server/scripts/Pet/pet_hunter.cpp
index c8dfc582bb7..87458fdc4dc 100644
--- a/src/server/scripts/Pet/pet_hunter.cpp
+++ b/src/server/scripts/Pet/pet_hunter.cpp
@@ -93,7 +93,7 @@ class npc_pet_hunter_snake_trap : public CreatureScript
void UpdateAI(uint32 diff) OVERRIDE
{
- if (!UpdateVictim())
+ if (!UpdateVictim() || !me->GetVictim())
return;
if (me->EnsureVictim()->HasBreakableByDamageCrowdControlAura(me))