mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 18:10:26 +00:00
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
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user