mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 09:17:18 +00:00
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:
@@ -1355,6 +1355,7 @@ public:
|
||||
void ApplyEnchantment(Item* item, bool apply);
|
||||
void UpdateSkillEnchantments(uint16 skill_id, uint16 curr_value, uint16 new_value);
|
||||
void SendEnchantmentDurations();
|
||||
void UpdateEnchantmentDurations();
|
||||
void BuildEnchantmentsInfoData(WorldPacket* data);
|
||||
void AddItemDurations(Item* item);
|
||||
void RemoveItemDurations(Item* item);
|
||||
|
||||
@@ -4758,6 +4758,14 @@ void Player::SendEnchantmentDurations()
|
||||
}
|
||||
}
|
||||
|
||||
void Player::UpdateEnchantmentDurations()
|
||||
{
|
||||
for (EnchantDurationList::iterator itr = m_enchantDuration.begin(); itr != m_enchantDuration.end(); ++itr)
|
||||
{
|
||||
itr->item->SetEnchantmentDuration(itr->slot, itr->leftduration, this);
|
||||
}
|
||||
}
|
||||
|
||||
void Player::SendItemDurations()
|
||||
{
|
||||
for (ItemDurationList::const_iterator itr = m_itemDuration.begin(); itr != m_itemDuration.end(); ++itr)
|
||||
|
||||
@@ -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)));
|
||||
|
||||
Reference in New Issue
Block a user