diff options
| author | Shauren <shauren.trinity@gmail.com> | 2025-01-09 13:23:48 +0100 |
|---|---|---|
| committer | Ovahlord <dreadkiller@gmx.de> | 2025-01-09 20:55:14 +0100 |
| commit | 9e26bf6a7f7dcf0802ca87cb976da7b5df24ff56 (patch) | |
| tree | 1ed562c5daab437e270ae941ad26ad6b074fcc3b /src/server/game/Spells/Spell.cpp | |
| parent | 08eb6312f28126d5305b4388c7c095fd17aac7c2 (diff) | |
Core/Auras: Make iteration over Aura::GetAuraEffects safe by automatically skipping nullptr elements
(cherry picked from commit 97f58a59f13fcf3a8a6675215674fb89b1a136ca)
# Conflicts:
# src/server/game/Entities/Player/Player.cpp
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
| -rw-r--r-- | src/server/game/Spells/Spell.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index fb4e5a00c1e..2d299e28296 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -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) |
