diff --git a/common/inventory_profile.cpp b/common/inventory_profile.cpp index b200388aa9..dbb3f6e1b4 100644 --- a/common/inventory_profile.cpp +++ b/common/inventory_profile.cpp @@ -1095,13 +1095,13 @@ int16 EQ::InventoryProfile::CalcSlotId(int16 bagslot_id, uint8 bagidx) if (bagslot_id == invslot::slotCursor) { slot_id = invbag::CURSOR_BAG_BEGIN + bagidx; } else if (EQ::ValueWithin(bagslot_id, invslot::GENERAL_BEGIN, invslot::GENERAL_END)) { - slot_id = invbag::GENERAL_BAGS_BEGIN + (bagslot_id - invbag::GENERAL_BAGS_BEGIN) * invbag::SLOT_COUNT + bagidx; + slot_id = invbag::GENERAL_BAGS_BEGIN + (bagslot_id - invslot::GENERAL_BEGIN) * invbag::SLOT_COUNT + bagidx; } else if (EQ::ValueWithin(bagslot_id, invslot::BANK_BEGIN, invslot::BANK_END)) { - slot_id = invbag::BANK_BAGS_BEGIN + (bagslot_id - invbag::BANK_BAGS_BEGIN) * invbag::SLOT_COUNT + bagidx; + slot_id = invbag::BANK_BAGS_BEGIN + (bagslot_id - invslot::BANK_BEGIN) * invbag::SLOT_COUNT + bagidx; } else if (EQ::ValueWithin(bagslot_id, invslot::SHARED_BANK_BEGIN, invslot::SHARED_BANK_END)) { - slot_id = invbag::SHARED_BANK_BAGS_BEGIN + (bagslot_id - invbag::SHARED_BANK_BAGS_BEGIN) * invbag::SLOT_COUNT + bagidx; + slot_id = invbag::SHARED_BANK_BAGS_BEGIN + (bagslot_id - invslot::SHARED_BANK_BEGIN) * invbag::SLOT_COUNT + bagidx; } else if (EQ::ValueWithin(bagslot_id, invslot::TRADE_BEGIN, invslot::TRADE_END)) { - slot_id = invbag::TRADE_BAGS_BEGIN + (bagslot_id - invbag::TRADE_BAGS_BEGIN) * invbag::SLOT_COUNT + bagidx; + slot_id = invbag::TRADE_BAGS_BEGIN + (bagslot_id - invslot::TRADE_BEGIN) * invbag::SLOT_COUNT + bagidx; } return slot_id; diff --git a/common/shareddb.cpp b/common/shareddb.cpp index a052c86520..d9f57f8bed 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -804,7 +804,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, EQ::InventoryProfile* inv) } int16 put_slot_id; - if (EQ::ValueWithin(slot_id, EQ::invbag::CURSOR_BAG_BEGIN, EQ::invbag::CURSOR_BAG_END) || slot_id == EQ::invslot::slotCursor) { + if (EQ::ValueWithin(slot_id, EQ::invbag::CURSOR_BAG_BEGIN, EQ::invbag::CURSOR_BAG_END)) { put_slot_id = inv->PushCursor(*inst); } else { put_slot_id = inv->PutItem(slot_id, *inst); diff --git a/zone/client_process.cpp b/zone/client_process.cpp index b8f3ace3eb..7e938e9743 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -779,47 +779,70 @@ void Client::BulkSendInventoryItems() inst->Serialize(ob, slot_id); - if (ob.tellp() == last_pos) + if (ob.tellp() == last_pos) { LogInventory("Serialization failed on item slot [{}] during BulkSendInventoryItems. Item skipped", slot_id); + } + + last_pos = ob.tellp(); + } + + // General items + for (int16 slot_id = EQ::invslot::GENERAL_BEGIN; slot_id <= EQ::invslot::GENERAL_END; slot_id++) { + const EQ::ItemInstance* inst = m_inv[slot_id]; + if (!inst) { + continue; + } + + inst->Serialize(ob, slot_id); + + if (ob.tellp() == last_pos) { + LogInventory("Serialization failed on item slot [{}] during BulkSendInventoryItems. Item skipped", slot_id); + } last_pos = ob.tellp(); } if (!RuleB(Inventory, LazyLoadBank)) { - // Bank items - for (int16 slot_id = EQ::invslot::BANK_BEGIN; slot_id <= EQ::invslot::BANK_END; slot_id++) { - const EQ::ItemInstance* inst = m_inv[slot_id]; - if (!inst) - continue; + // Bank items + for (int16 slot_id = EQ::invslot::BANK_BEGIN; slot_id <= EQ::invslot::BANK_END; slot_id++) { + const EQ::ItemInstance* inst = m_inv[slot_id]; + if (!inst) { + continue; + } - inst->Serialize(ob, slot_id); + inst->Serialize(ob, slot_id); - if (ob.tellp() == last_pos) - LogInventory("Serialization failed on item slot [{}] during BulkSendInventoryItems. Item skipped", slot_id); + if (ob.tellp() == last_pos) { + LogInventory("Serialization failed on item slot [{}] during BulkSendInventoryItems. Item skipped", slot_id); + } - last_pos = ob.tellp(); - } + last_pos = ob.tellp(); + } - // SharedBank items - for (int16 slot_id = EQ::invslot::SHARED_BANK_BEGIN; slot_id <= EQ::invslot::SHARED_BANK_END; slot_id++) { - const EQ::ItemInstance* inst = m_inv[slot_id]; - if (!inst) - continue; + // SharedBank items + for (int16 slot_id = EQ::invslot::SHARED_BANK_BEGIN; slot_id <= EQ::invslot::SHARED_BANK_END; slot_id++) { + const EQ::ItemInstance* inst = m_inv[slot_id]; + if (!inst) { + continue; + } - inst->Serialize(ob, slot_id); + inst->Serialize(ob, slot_id); - if (ob.tellp() == last_pos) - LogInventory("Serialization failed on item slot [{}] during BulkSendInventoryItems. Item skipped", slot_id); + if (ob.tellp() == last_pos) { + LogInventory("Serialization failed on item slot [{}] during BulkSendInventoryItems. Item skipped", slot_id); + } + + last_pos = ob.tellp(); + } + } + + auto outapp = new EQApplicationPacket(OP_CharInventory); - last_pos = ob.tellp(); - } - } + outapp->size = ob.size(); + outapp->pBuffer = ob.detach(); - auto outapp = new EQApplicationPacket(OP_CharInventory); - outapp->size = ob.size(); - outapp->pBuffer = ob.detach(); - QueuePacket(outapp); - safe_delete(outapp); + QueuePacket(outapp); + safe_delete(outapp); } void Client::BulkSendMerchantInventory(int merchant_id, int npcid) { diff --git a/zone/gm_commands/show/inventory.cpp b/zone/gm_commands/show/inventory.cpp index 2078f2bdd6..2cffdc82f0 100644 --- a/zone/gm_commands/show/inventory.cpp +++ b/zone/gm_commands/show/inventory.cpp @@ -310,7 +310,7 @@ void ShowInventory(Client *c, const Seperator *sep) Chat::White, fmt::format( "Slot {} | {} ({}){}", - (EQ::invbag::CURSOR_BAG_BEGIN + limboIndex), + (14000 + limboIndex), item_data->ID, linker.GenerateLink(), ( @@ -339,7 +339,7 @@ void ShowInventory(Client *c, const Seperator *sep) Chat::White, fmt::format( "Slot {} (Augment Slot {}) | {} ({}){}", - (EQ::invbag::CURSOR_BAG_BEGIN + limboIndex), + (14000 + limboIndex), augment_index, linker.GenerateLink(), item_data->ID, @@ -375,7 +375,7 @@ void ShowInventory(Client *c, const Seperator *sep) Chat::White, fmt::format( "Slot {} Bag Slot {} | {} ({}){}", - (EQ::invbag::CURSOR_BAG_BEGIN + limboIndex), + (14000 + limboIndex), sub_index, linker.GenerateLink(), item_data->ID, @@ -407,7 +407,7 @@ void ShowInventory(Client *c, const Seperator *sep) Chat::White, fmt::format( "Slot {} Bag Slot {} (Augment Slot {}) | {} ({}){}", - (EQ::invbag::CURSOR_BAG_BEGIN + limboIndex), + (14000 + limboIndex), sub_index, augment_index, linker.GenerateLink(),