reduce item instance guid consume

This commit is contained in:
Yunfan Li
2023-08-05 23:23:56 +08:00
parent 2e592bce13
commit 48bf9d083a
2 changed files with 5 additions and 2 deletions

View File

@@ -1409,7 +1409,10 @@ void PlayerbotFactory::InitBags()
for (uint8 slot = INVENTORY_SLOT_BAG_START; slot < INVENTORY_SLOT_BAG_END; ++slot)
{
uint32 newItemId = 23162;
Item *old_bag = bot->GetItemByPos(INVENTORY_SLOT_BAG_0, slot);
if (old_bag && old_bag->GetTemplate()->ItemId == newItemId) {
continue;
}
uint16 dest;
if (!CanEquipUnseenItem(slot, dest, newItemId))
continue;

View File

@@ -154,7 +154,7 @@ ItemUsage ItemUsageValue::QueryItemUsageForEquip(ItemTemplate const* itemProto)
if (itemProto->InventoryType == INVTYPE_NON_EQUIP)
return ITEM_USAGE_NONE;
Item* pItem = Item::CreateItem(itemProto->ItemId, 1, bot);
Item* pItem = Item::CreateItem(itemProto->ItemId, 1, bot, false, 0, true);
if (!pItem)
return ITEM_USAGE_NONE;