Merge branch 'master' into Playerbot

This commit is contained in:
Yunfan Li
2024-03-28 19:15:09 +08:00
36 changed files with 3768 additions and 729 deletions

View File

@@ -708,6 +708,15 @@ void WorldSession::HandleSetTradeItemOpcode(WorldPacket& recvPacket)
return;
}
// PlayerScript Hook for checking traded items if we want to filter them in a custom module
if (!sScriptMgr->CanSetTradeItem(_player, item, tradeSlot))
{
// Do not send TRADE_STATUS_TRADE_CANCELED because it will cause double display of "Transaction canceled" notification
// On the trade initiator screen
SendTradeStatus(TRADE_STATUS_CLOSE_WINDOW);
return;
}
my_trade->SetItem(TradeSlots(tradeSlot), item);
}