Core/Units: ensure that we use valid iterators when providing spell Ids in Unit::RemoveAppliedAuras and Unit::RemoveOwnedAuras

This commit is contained in:
Ovahlord committed 2022-11-23 21:01:09 +01:00
1 parent 3a401564c2
commit dd43ca3e6a
1 file changed
+2
+2
View File
@@ -3502,6 +3502,7 @@ void Unit::RemoveAppliedAuras(uint32 spellId, std::function<bool(AuraApplication
if (check(iter->second))
{
RemoveAura(iter, removeMode);
iter = m_appliedAuras.lower_bound(spellId);
continue;
}
++iter;
@@ -3515,6 +3516,7 @@ void Unit::RemoveOwnedAuras(uint32 spellId, std::function<bool(Aura const*)> con
if (check(iter->second))
{
RemoveOwnedAura(iter, removeMode);
iter = m_ownedAuras.lower_bound(spellId);
continue;
}
++iter;