fix(Scripts/MoltenCore): Ragnaros targetting dead player

This commit is contained in:
Noxies
2021-12-23 15:10:28 +01:00
committed by GitHub
parent 08d71d38d5
commit 9c4f1035cf

View File

@@ -334,6 +334,14 @@ public:
}
case EVENT_MAGMA_BLAST_MELEE_CHECK:
{
if (Unit* target = ObjectAccessor::GetUnit(*me, me->GetTarget()))
{
if (!target->IsAlive())
{
me->SetTarget(ObjectGuid::Empty);
}
}
if (!IsVictimWithinMeleeRange())
{
if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 0, [&](Unit* u) { return u && u->IsPlayer() && me->IsWithinMeleeRange(u); }))