Skip to content

Commit

Permalink
Item/Spell: Add enchantment log on enchant removal
Browse files Browse the repository at this point in the history
  • Loading branch information
killerwife committed Jun 1, 2022
1 parent 370ebc1 commit 9d676a1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/game/Entities/Item.cpp
Expand Up @@ -1044,6 +1044,11 @@ void Item::ClearEnchantment(EnchantmentSlot slot)
if (!GetEnchantmentId(slot))
return;

if (slot < MAX_INSPECTED_ENCHANTMENT_SLOT)
if (uint32 oldEnchant = GetEnchantmentId(slot))
if (Player* owner = GetOwner())
owner->SendEnchantmentLog(ObjectGuid(), GetEntry(), oldEnchant);

for (uint8 x = 0; x < 3; ++x)
SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot * MAX_ENCHANTMENT_OFFSET + x, 0);
SetState(ITEM_CHANGED);
Expand Down

0 comments on commit 9d676a1

Please sign in to comment.