fix(Core/Items): Don't remove all owned auras on removing enchantments. (#20220)

This commit is contained in:
Anton Popovichenko 2024-10-16 11:14:09 +02:00 committed by GitHub
parent 6b40e51b66
commit cb241a35e7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5095,10 +5095,13 @@ void Unit::RemoveAurasDueToItemSpell(uint32 spellId, ObjectGuid castItemGuid)
++iter;
}
for (AuraMap::iterator iter = m_ownedAuras.begin(); iter != m_ownedAuras.end();)
for (AuraMap::iterator iter = m_ownedAuras.lower_bound(spellId); iter != m_ownedAuras.upper_bound(spellId);)
{
if (iter->second->GetCastItemGUID() == castItemGuid)
RemoveOwnedAura(iter, AURA_REMOVE_BY_DEFAULT);
{
RemoveOwnedAura(iter, AURA_REMOVE_BY_DEFAULT);
iter = m_ownedAuras.lower_bound(spellId);
}
else
++iter;
}