Core/Creatures: Removed vendor item check during loading, MAX_VENDOR_ITEMS should apply to filtered list of items depending on player opening the vendor, not global list size

Closes #10330
This commit is contained in:
Shauren
2013-07-22 17:12:29 +02:00
parent 3d6b88f5aa
commit 3a4e3a5fa9
2 changed files with 3 additions and 11 deletions

View File

@@ -8362,15 +8362,6 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max
return false;
}
if (vItems->GetItemCount() >= MAX_VENDOR_ITEMS)
{
if (player)
ChatHandler(player->GetSession()).SendSysMessage(LANG_COMMAND_ADDVENDORITEMITEMS);
else
TC_LOG_ERROR(LOG_FILTER_SQL, "Table `npc_vendor` has too many items (%u >= %i) for vendor (Entry: %u), ignore", vItems->GetItemCount(), MAX_VENDOR_ITEMS, vendor_entry);
return false;
}
return true;
}

View File

@@ -784,8 +784,6 @@ void WorldSession::SendListInventory(uint64 vendorGuid)
continue;
}
++count;
// reputation discount
int32 price = item->IsGoldRequired(itemTemplate) ? uint32(floor(itemTemplate->BuyPrice * discountMod)) : 0;
@@ -797,6 +795,9 @@ void WorldSession::SendListInventory(uint64 vendorGuid)
data << uint32(itemTemplate->MaxDurability);
data << uint32(itemTemplate->BuyCount);
data << uint32(item->ExtendedCost);
if (++count >= MAX_VENDOR_ITEMS)
break;
}
}
}