Navigation Menu

Skip to content

Commit

Permalink
Scripts/EyeOfEternity: Fix crash added in d1853f6
Browse files Browse the repository at this point in the history
Close #14984 (comment)

(cherry picked from commit 275bb93)
  • Loading branch information
jackpoz authored and DDuarte committed Jul 3, 2015
1 parent e98b8fa commit dbf51ee
Showing 1 changed file with 5 additions and 5 deletions.
Expand Up @@ -1530,15 +1530,14 @@ class npc_wyrmrest_skytalon : public CreatureScript
{
npc_wyrmrest_skytalonAI(Creature* creature) : VehicleAI(creature)
{
_summoner = NULL;
}

void IsSummonedBy(Unit* summoner) override
{
_summoner = NULL;
_summoner.Clear();
if (Player* player = summoner->ToPlayer())
{
_summoner = player;
_summoner = player->GetGUID();
_events.ScheduleEvent(EVENT_CAST_RIDE_SPELL, 2*IN_MILLISECONDS);
}
}
Expand All @@ -1553,7 +1552,8 @@ class npc_wyrmrest_skytalon : public CreatureScript
switch (eventId)
{
case EVENT_CAST_RIDE_SPELL:
me->CastSpell(_summoner, SPELL_RIDE_RED_DRAGON_TRIGGERED, true);
if (Player* player = ObjectAccessor::GetPlayer(*me, _summoner))
me->CastSpell(player, SPELL_RIDE_RED_DRAGON_TRIGGERED, true);
break;
}
}
Expand All @@ -1575,7 +1575,7 @@ class npc_wyrmrest_skytalon : public CreatureScript
}

private:
Player* _summoner;
ObjectGuid _summoner;
EventMap _events;
};

Expand Down

0 comments on commit dbf51ee

Please sign in to comment.