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

@@ -295,7 +295,8 @@ public:
return false;
}
uint32 vendor_entry = vendor->GetEntry();
char* addMulti = strtok(nullptr, " ");
uint32 vendor_entry = addMulti ? handler->GetSession()->GetCurrentVendor() : vendor->GetEntry();
if (!sObjectMgr->IsVendorItemValid(vendor_entry, itemId, maxcount, incrtime, extendedcost, handler->GetSession()->GetPlayer()))
{
@@ -518,7 +519,8 @@ public:
}
uint32 itemId = atol(pitem);
if (!sObjectMgr->RemoveVendorItem(vendor->GetEntry(), itemId))
char* addMulti = strtok(NULL, " ");
if (!sObjectMgr->RemoveVendorItem(addMulti ? handler->GetSession()->GetCurrentVendor() : vendor->GetEntry(), itemId))
{
handler->PSendSysMessage(LANG_ITEM_NOT_IN_LIST, itemId);
handler->SetSentErrorMessage(true);