Core/Spells: replaced SPELLVALUE_AURA_DURATION implementation with master's SPELLVALUE_DURATION version

This commit is contained in:
Ovahlord committed 2022-10-16 11:20:51 +02:00
1 parent 6989797014
commit 0166f84a1b
4 files changed
+12 -8

No files matched your search

+9 -5
View File
@@ -538,7 +538,6 @@ SpellValue::SpellValue(SpellInfo const* proto)
MaxAffectedTargets = proto->MaxAffectedTargets;
RadiusMod = 1.0f;
AuraStackAmount = 1;
AuraDuration = 0;
CriticalChance = 0.f;
}
@@ -3071,7 +3070,7 @@ void Spell::DoSpellEffectHit(Unit* unit, uint8 effIndex, TargetInfo& hitInfo)
hitInfo.HitAura->SetDiminishGroup(hitInfo.DRGroup);
//if (!m_spellValue->Duration)
if (!m_spellValue->Duration.has_value())
{
hitInfo.AuraDuration = caster->ModSpellDuration(hitInfo.AuraSpellInfo, unit, hitInfo.AuraDuration, hitInfo.Positive, hitInfo.HitAura->GetEffectMask());
if (hitInfo.AuraDuration > 0)
@@ -3098,6 +3097,8 @@ void Spell::DoSpellEffectHit(Unit* unit, uint8 effIndex, TargetInfo& hitInfo)
hitInfo.AuraDuration += hitInfo.HitAura->GetRolledOverDuration();
}
}
else
hitInfo.AuraDuration = *m_spellValue->Duration;
if (hitInfo.AuraDuration != hitInfo.HitAura->GetMaxDuration())
{
@@ -3782,8 +3783,11 @@ void Spell::handle_immediate()
if (m_spellInfo->IsChanneled())
{
int32 duration = Aura::CalcMaxDuration(m_spellInfo, m_caster);
if (duration > 0)
if (duration > 0 || m_spellValue->Duration)
{
if (m_spellValue->Duration)
duration = *m_spellValue->Duration;
m_channeledDuration = duration;
SendChannelStart(duration);
}
@@ -8162,8 +8166,8 @@ void Spell::SetSpellValue(SpellValueMod mod, int32 value)
case SPELLVALUE_AURA_STACK:
m_spellValue->AuraStackAmount = uint8(value);
break;
case SPELLVALUE_AURA_DURATION:
m_spellValue->AuraDuration = int32(value);
case SPELLVALUE_DURATION:
m_spellValue->Duration = value;
break;
default:
break;