mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Auras: Make iteration over Aura::GetAuraEffects safe by automatically skipping nullptr elements
This commit is contained in:
@@ -3284,9 +3284,8 @@ void Spell::DoSpellEffectHit(Unit* unit, SpellEffectInfo const& spellEffectInfo,
|
||||
int32 origDuration = hitInfo.AuraDuration;
|
||||
hitInfo.AuraDuration = 0;
|
||||
for (AuraEffect const* auraEff : hitInfo.HitAura->GetAuraEffects())
|
||||
if (auraEff)
|
||||
if (int32 period = auraEff->GetPeriod()) // period is hastened by UNIT_MOD_CAST_SPEED
|
||||
hitInfo.AuraDuration = std::max(std::max(origDuration / period, 1) * period, hitInfo.AuraDuration);
|
||||
if (int32 period = auraEff->GetPeriod()) // period is hastened by UNIT_MOD_CAST_SPEED
|
||||
hitInfo.AuraDuration = std::max(std::max(origDuration / period, 1) * period, hitInfo.AuraDuration);
|
||||
|
||||
// if there is no periodic effect
|
||||
if (!hitInfo.AuraDuration)
|
||||
|
||||
Reference in New Issue
Block a user