diff --git a/common/inventory_profile.cpp b/common/inventory_profile.cpp index bbc69c1a7..ac1e46fa6 100644 --- a/common/inventory_profile.cpp +++ b/common/inventory_profile.cpp @@ -260,6 +260,10 @@ int16 EQ::InventoryProfile::PutItem(int16 slot_id, const ItemInstance& inst) } int16 EQ::InventoryProfile::PushCursor(const ItemInstance &inst) { + if (inst.GetSerialNumber2().empty()) { + inst.CreateSerialNumber2(); + } + m_cursor.push(inst.Clone()); return invslot::slotCursor; } diff --git a/common/item_instance.h b/common/item_instance.h index 25d977fd5..517d1f539 100644 --- a/common/item_instance.h +++ b/common/item_instance.h @@ -238,7 +238,7 @@ namespace EQ //std::string &GetSerialNumber2() const { return m_serial_number2; } void SetSerialNumber2(std::string sn) { m_serial_number2 = std::move(sn); } - void CreateSerialNumber2() + void CreateSerialNumber2() const { m_serial_number2 = GenerateUniqueSerialNumber(); } @@ -371,7 +371,7 @@ namespace EQ bool m_attuned{false}; int32 m_merchantcount{1};//number avaliable on the merchant, -1=unlimited int32 m_SerialNumber{0}; // Unique identifier for this instance of an item. Needed for Bazaar. - std::string m_serial_number2{}; // unique serial number across all zones/world TESTING March 2025 + mutable std::string m_serial_number2{}; // unique serial number across all zones/world TESTING March 2025 uint32 m_exp{0}; int8 m_evolveLvl{0}; ItemData * m_scaledItem{nullptr}; diff --git a/zone/inventory.cpp b/zone/inventory.cpp index 839cfa784..8845e055f 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -650,9 +650,8 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // put item into inventory if (to_slot == EQ::invslot::slotCursor) { - inst->CreateSerialNumber2(); - PushItemOnCursor(*inst); - SendItemPacket(EQ::invslot::slotCursor, inst, ItemPacketLimbo); + PushItemOnCursor(*inst, true); + //SendItemPacket(EQ::invslot::slotCursor, inst, ItemPacketLimbo); } else { PutItemInInventory(to_slot, *inst, true); } @@ -1056,6 +1055,10 @@ bool Client::PushItemOnCursor(const EQ::ItemInstance& inst, bool client_update) bool Client::PutItemInInventory(int16 slot_id, const EQ::ItemInstance& inst, bool client_update) { LogInventory("Putting item [{}] ([{}]) into slot [{}]", inst.GetItem()->Name, inst.GetItem()->ID, slot_id); + if (inst.GetSerialNumber2().empty()) { + inst.CreateSerialNumber2(); + } + if (slot_id == EQ::invslot::slotCursor) { // don't trust macros before conditional statements... return PushItemOnCursor(inst, client_update); }