Core/Spells: Make sure that spells with overridden duration but default duration 0 are not flagged immune

This commit is contained in:
ModoX
2026-02-05 12:49:31 +01:00
parent bee853f11f
commit ee0c30a968

View File

@@ -3201,7 +3201,10 @@ SpellMissInfo Spell::PreprocessSpellHit(Unit* unit, TargetInfo& hitInfo)
}
}
hitInfo.AuraDuration = Aura::CalcMaxDuration(m_spellInfo, origCaster, &m_powerCost);
if (m_spellValue->Duration)
hitInfo.AuraDuration = *m_spellValue->Duration;
else
hitInfo.AuraDuration = Aura::CalcMaxDuration(m_spellInfo, origCaster, &m_powerCost);
// unit is immune to aura if it was diminished to 0 duration
if (!hitInfo.Positive && !unit->ApplyDiminishingToDuration(m_spellInfo, hitInfo.AuraDuration, origCaster, diminishLevel))