fix(Core/Unit): Fix crash during Judgement of Light/Wisdom proc (#20467)
This commit is contained in:
committed by
GitHub
parent
6c69bd5b53
commit
12a41df8bc
@@ -7770,8 +7770,13 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
|||||||
// Judgement of Light
|
// Judgement of Light
|
||||||
case 20185:
|
case 20185:
|
||||||
{
|
{
|
||||||
if (!victim || !victim->IsAlive() || victim->HasSpellCooldown(20267) || !victim->IsFriendlyTo(triggeredByAura->GetBase()->GetCaster()))
|
if (!victim || !victim->IsAlive() || victim->HasSpellCooldown(20267))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
auto* caster = triggeredByAura->GetBase()->GetCaster();
|
||||||
|
if (!caster || !victim->IsFriendlyTo(caster))
|
||||||
|
return false;
|
||||||
|
|
||||||
// 2% of base health
|
// 2% of base health
|
||||||
basepoints0 = int32(victim->CountPctFromMaxHealth(2));
|
basepoints0 = int32(victim->CountPctFromMaxHealth(2));
|
||||||
victim->CastCustomSpell(victim, 20267, &basepoints0, 0, 0, true, 0, triggeredByAura);
|
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
|
// Judgement of Wisdom
|
||||||
case 20186:
|
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;
|
return false;
|
||||||
|
|
||||||
// 2% of base mana
|
// 2% of base mana
|
||||||
|
|||||||
Reference in New Issue
Block a user