feat(Core/SendListInventory): Add multivendor function (#3172)

This commit is contained in:
IntelligentQuantum
2020-08-20 13:30:11 +04:30
committed by GitHub
parent 07c9debb0d
commit 5d284f02a7
6 changed files with 21 additions and 10 deletions

View File

@@ -887,7 +887,7 @@ void WorldSession::HandleListInventoryOpcode(WorldPacket & recvData)
SendListInventory(guid);
}
void WorldSession::SendListInventory(uint64 vendorGuid)
void WorldSession::SendListInventory(uint64 vendorGuid, uint32 vendorEntry)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_LIST_INVENTORY");
@@ -911,7 +911,9 @@ void WorldSession::SendListInventory(uint64 vendorGuid)
if (vendor->HasUnitState(UNIT_STATE_MOVING))
vendor->StopMoving();
VendorItemData const* items = vendor->GetVendorItems();
SetCurrentVendor(vendorEntry);
VendorItemData const* items = vendorEntry ? sObjectMgr->GetNpcVendorItemList(vendorEntry) : vendor->GetVendorItems();
if (!items)
{
WorldPacket data(SMSG_LIST_INVENTORY, 8 + 1 + 1);