fix(Core/Items): Properly transfer enchantment durations from old to … (#11828)

fix(Core/Items): Properly transfer enchantment durations from old to newly created/summoned items.

Fixes #11687
This commit is contained in:
UltraNix
2022-05-23 09:27:53 +02:00
committed by GitHub
parent 99f1cd84e2
commit 914ea4f9c3
3 changed files with 12 additions and 0 deletions

View File

@@ -2213,6 +2213,9 @@ void Spell::EffectSummonChangeItem(SpellEffIndex effIndex)
if (!pNewItem)
return;
// Client-side enchantment durations update
player->UpdateEnchantmentDurations();
for (uint8 j = PERM_ENCHANTMENT_SLOT; j <= TEMP_ENCHANTMENT_SLOT; ++j)
if (m_CastItem->GetEnchantmentId(EnchantmentSlot(j)))
pNewItem->SetEnchantment(EnchantmentSlot(j), m_CastItem->GetEnchantmentId(EnchantmentSlot(j)), m_CastItem->GetEnchantmentDuration(EnchantmentSlot(j)), m_CastItem->GetEnchantmentCharges(EnchantmentSlot(j)));