diff options
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 46b0f9bc681..63b8ad8f6c2 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -2123,15 +2123,11 @@ void Unit::AttackerStateUpdate(Unit* victim, WeaponAttackType attType, bool extr victim = GetMeleeHitRedirectTarget(victim); AuraEffectList const& meleeAttackOverrides = GetAuraEffectsByType(SPELL_AURA_OVERRIDE_AUTOATTACK_WITH_MELEE_SPELL); - AuraEffect const* meleeAttackAuraEffect = nullptr; uint32 meleeAttackSpellId = 0; if (attType == BASE_ATTACK) { if (!meleeAttackOverrides.empty()) - { - meleeAttackAuraEffect = meleeAttackOverrides.front(); - meleeAttackSpellId = meleeAttackAuraEffect->GetSpellEffectInfo().TriggerSpell; - } + meleeAttackSpellId = meleeAttackOverrides.front()->GetSpellEffectInfo().TriggerSpell; } else { @@ -2140,13 +2136,10 @@ void Unit::AttackerStateUpdate(Unit* victim, WeaponAttackType attType, bool extr return aurEff->GetSpellEffectInfo().MiscValue != 0; }); if (itr != meleeAttackOverrides.end()) - { - meleeAttackAuraEffect = *itr; - meleeAttackSpellId = meleeAttackAuraEffect->GetSpellEffectInfo().MiscValue; - } + meleeAttackSpellId = (*itr)->GetSpellEffectInfo().MiscValue; } - if (!meleeAttackAuraEffect) + if (!meleeAttackSpellId) { CalcDamageInfo damageInfo; CalculateMeleeDamage(victim, &damageInfo, attType); @@ -2174,7 +2167,7 @@ void Unit::AttackerStateUpdate(Unit* victim, WeaponAttackType attType, bool extr } else { - CastSpell(victim, meleeAttackSpellId, meleeAttackAuraEffect); + CastSpell(victim, meleeAttackSpellId, true); uint32 hitInfo = HITINFO_AFFECTS_VICTIM | HITINFO_NO_ANIMATION; if (attType == OFF_ATTACK) |