fix(Core/Unit): Fix crash during Judgement of Light/Wisdom proc (#20467)
This commit is contained in:
parent
6c69bd5b53
commit
12a41df8bc
1 changed files with 11 additions and 2 deletions
|
|
@ -7770,8 +7770,13 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
|||
// Judgement of Light
|
||||
case 20185:
|
||||
{
|
||||
if (!victim || !victim->IsAlive() || victim->HasSpellCooldown(20267) || !victim->IsFriendlyTo(triggeredByAura->GetBase()->GetCaster()))
|
||||
if (!victim || !victim->IsAlive() || victim->HasSpellCooldown(20267))
|
||||
return false;
|
||||
|
||||
auto* caster = triggeredByAura->GetBase()->GetCaster();
|
||||
if (!caster || !victim->IsFriendlyTo(caster))
|
||||
return false;
|
||||
|
||||
// 2% of base health
|
||||
basepoints0 = int32(victim->CountPctFromMaxHealth(2));
|
||||
victim->CastCustomSpell(victim, 20267, &basepoints0, 0, 0, true, 0, triggeredByAura);
|
||||
|
|
@ -7781,7 +7786,11 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
|||
// Judgement of Wisdom
|
||||
case 20186:
|
||||
{
|
||||
if (!victim || !victim->IsAlive() || !victim->HasActivePowerType(POWER_MANA) || victim->HasSpellCooldown(20268) || !victim->IsFriendlyTo(triggeredByAura->GetBase()->GetCaster()))
|
||||
if (!victim || !victim->IsAlive() || !victim->HasActivePowerType(POWER_MANA) || victim->HasSpellCooldown(20268))
|
||||
return false;
|
||||
|
||||
auto* caster = triggeredByAura->GetBase()->GetCaster();
|
||||
if (!caster || !victim->IsFriendlyTo(caster))
|
||||
return false;
|
||||
|
||||
// 2% of base mana
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue