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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user