diff options
| author | Shauren <shauren.trinity@gmail.com> | 2025-02-05 20:35:13 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2025-02-05 20:35:13 +0100 |
| commit | fc54ae79a95bc162bd0ceec199561af873576a23 (patch) | |
| tree | bc3491530fbec8edbd96c906a149c1bad07ffe01 /src/server/game/Spells | |
| parent | 9201c0f035308af07ef416a7a10fbaa98176badb (diff) | |
Core/Auras: Ensure aura target of SPELL_AURA_TRIGGER_SPELL_ON_POWER_PCT has required power type
Closes #30669
Diffstat (limited to 'src/server/game/Spells')
| -rw-r--r-- | src/server/game/Spells/Auras/SpellAuraEffects.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index bc414da722f..90a5d78cee3 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -5327,7 +5327,11 @@ void AuraEffect::HandleTriggerSpellOnPowerPercent(AuraApplication const* aurApp, int32 effectAmount = GetAmount(); uint32 triggerSpell = GetSpellEffectInfo().TriggerSpell; - float powerAmountPct = GetPctOf(target->GetPower(Powers(GetMiscValue())), target->GetMaxPower(Powers(GetMiscValue()))); + int32 maxPower = target->GetMaxPower(Powers(GetMiscValue())); + if (!maxPower) + return; + + float powerAmountPct = GetPctOf(target->GetPower(Powers(GetMiscValue())), maxPower); switch (AuraTriggerOnPowerChangeDirection(GetMiscValueB())) { |
