Pass 5 - WIP

This commit is contained in:
Mitch Freeman 2025-03-31 18:05:42 -03:00
parent caa335cd85
commit 1519c2429a
3 changed files with 12 additions and 5 deletions

View File

@ -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;
}

View File

@ -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};

View File

@ -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);
}