diff options
| author | ariel- <ariel-@users.noreply.github.com> | 2018-01-14 17:17:46 -0300 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2021-06-15 23:22:01 +0200 |
| commit | 08ac27d9598d8b2708de502ed9d83a554949af93 (patch) | |
| tree | 8c17a945f720c79e5d9b7d2efcf84206b7d2cc28 /src | |
| parent | bf4330bfb58d5c23b651bc8397a15b10f33672b8 (diff) | |
Core/Auras: fix static analysis issues
CID 1384433
CID 1384436
(cherry picked from commit 5153f464d8a4e5ae0b47900f92eeaf6c9f9eee50)
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/game/Spells/Auras/SpellAuraEffects.cpp | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 3e9aa2566cf..3926ed4420b 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -5161,9 +5161,6 @@ void AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick(Unit* target, Unit* void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const { - // dynobj auras must always have a caster - ASSERT(GetSpellEffectInfo()->Effect != SPELL_EFFECT_PERSISTENT_AREA_AURA || caster); - if (!target->IsAlive()) return; @@ -5174,8 +5171,9 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const } // Consecrate ticks can miss and will not show up in the combat log + // dynobj auras must always have a caster if (GetSpellEffectInfo()->Effect == SPELL_EFFECT_PERSISTENT_AREA_AURA && - caster->SpellHitResult(target, GetSpellInfo(), false) != SPELL_MISS_NONE) + ASSERT_NOTNULL(caster)->SpellHitResult(target, GetSpellInfo(), false) != SPELL_MISS_NONE) return; CleanDamage cleanDamage = CleanDamage(0, 0, BASE_ATTACK, MELEE_HIT_NORMAL); @@ -5304,9 +5302,6 @@ bool AuraEffect::IsAreaAuraEffect() const void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) const { - // dynobj auras must always have a caster - ASSERT(GetSpellEffectInfo()->Effect != SPELL_EFFECT_PERSISTENT_AREA_AURA || caster); - if (!target->IsAlive()) return; @@ -5316,8 +5311,9 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c return; } + // dynobj auras must always have a caster if (GetSpellEffectInfo()->Effect == SPELL_EFFECT_PERSISTENT_AREA_AURA && - caster->SpellHitResult(target, GetSpellInfo(), false) != SPELL_MISS_NONE) + ASSERT_NOTNULL(caster)->SpellHitResult(target, GetSpellInfo(), false) != SPELL_MISS_NONE) return; CleanDamage cleanDamage = CleanDamage(0, 0, GetSpellInfo()->GetAttackType(), MELEE_HIT_NORMAL); @@ -5383,11 +5379,12 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c } int32 new_damage = Unit::DealDamage(caster, target, damage, &cleanDamage, DOT, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), false); + Unit::ProcSkillsAndAuras(caster, target, procAttacker, procVictim, PROC_SPELL_TYPE_DAMAGE, PROC_SPELL_PHASE_NONE, hitMask, nullptr, &damageInfo, nullptr); + + // process caster heal from now on (must be in world) if (!caster || !caster->IsAlive()) return; - Unit::ProcSkillsAndAuras(caster, target, procAttacker, procVictim, PROC_SPELL_TYPE_DAMAGE, PROC_SPELL_PHASE_NONE, hitMask, nullptr, &damageInfo, nullptr); - float gainMultiplier = GetSpellEffectInfo()->CalcValueMultiplier(caster); uint32 heal = caster->SpellHealingBonusDone(caster, GetSpellInfo(), uint32(new_damage * gainMultiplier), DOT, GetSpellEffectInfo(), stackAmountForBonuses); @@ -5434,9 +5431,6 @@ void AuraEffect::HandlePeriodicHealthFunnelAuraTick(Unit* target, Unit* caster) void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const { - // dynobj auras must always have a caster - ASSERT(GetSpellEffectInfo()->Effect != SPELL_EFFECT_PERSISTENT_AREA_AURA || caster); - if (!target->IsAlive()) return; |
