Skip to content

Commit

Permalink
Scripts/Ulduar: Fixes Flame Leviathan entering evade mode if Pursue r…
Browse files Browse the repository at this point in the history
…eturns no target

* Pursue is never cast on players at retail, however, being there without a vehicle doesn't prevent the boss from attacking you, nor does it enter evade mode.

Closes #11199

(cherry picked from commit 9671d51)
  • Loading branch information
Nyeriah committed Dec 29, 2014
1 parent c5a79fe commit 1d83ce3
Showing 1 changed file with 7 additions and 7 deletions.
Expand Up @@ -548,6 +548,11 @@ class boss_flame_leviathan : public CreatureScript
if (me->isAttackReady())
{
Unit* target = ObjectAccessor::GetUnit(*me, _pursueTarget);

// Pursue was unable to acquire a valid target, so get the current victim as target.
if (!target && me->GetVictim())

This comment has been minimized.

Copy link
@jackpoz

jackpoz Dec 29, 2014

Member

NULL checking GetVictim() is not required, target will have same value anyway

target = me->GetVictim();

if (me->IsWithinCombatRange(target, 30.0f))
{
DoCast(target, SPELL_BATTERING_RAM);
Expand Down Expand Up @@ -1648,7 +1653,7 @@ class FlameLeviathanPursuedTargetSelector

bool operator()(WorldObject* target) const
{
//! No players, only vehicles (@todo check if blizzlike)
//! No players, only vehicles. Pursue is never cast on players.
Creature* creatureTarget = target->ToCreature();
if (!creatureTarget)
return true;
Expand Down Expand Up @@ -1698,12 +1703,7 @@ class spell_pursue : public SpellScriptLoader
void FilterTargets(std::list<WorldObject*>& targets)
{
targets.remove_if(FlameLeviathanPursuedTargetSelector(GetCaster()));
if (targets.empty())
{
if (Creature* caster = GetCaster()->ToCreature())
caster->AI()->EnterEvadeMode();
}
else
if (!targets.empty())
{
//! In the end, only one target should be selected
_target = Trinity::Containers::SelectRandomContainerElement(targets);
Expand Down

0 comments on commit 1d83ce3

Please sign in to comment.