feat(Core/PlayerScript): Add Unequip hook (#23248)

Co-authored-by: Munzeria <Munzeria@dontemailme.lol>
Co-authored-by: sudlud <sudlud@users.noreply.github.com>
This commit is contained in:
Munzeria
2025-12-27 00:09:56 +01:00
committed by GitHub
parent d54253310a
commit ae8dd49fd4
4 changed files with 16 additions and 0 deletions
@@ -3540,6 +3540,8 @@ void Player::SwapItem(uint16 src, uint16 dst)
Item* pSrcItem = GetItemByPos(srcbag, srcslot);
Item* pDstItem = GetItemByPos(dstbag, dstslot);
bool isUnequipingItem = false;
if (!pSrcItem)
return;
@@ -3570,6 +3572,7 @@ void Player::SwapItem(uint16 src, uint16 dst)
SendEquipError(msg, pSrcItem, pDstItem);
return;
}
isUnequipingItem = true;
}
// anti-wpe
@@ -3670,6 +3673,9 @@ void Player::SwapItem(uint16 src, uint16 dst)
AutoUnequipOffhandIfNeed();
}
if (isUnequipingItem)
sScriptMgr->OnPlayerUnequip(this, pSrcItem);
return;
}