Fix parcel slot duplication for evolving item augments

This commit is contained in:
Bemvaras
2025-06-23 09:34:59 -06:00
committed by Barathos
parent fb0747fe02
commit 10840753b0
+26 -19
View File
@@ -337,24 +337,29 @@ bool Client::DoEvolveCheckProgression(EQ::ItemInstance &inst)
!RuleB(EvolvingItems, DestroyAugmentsOnEvolve) && !RuleB(EvolvingItems, DestroyAugmentsOnEvolve) &&
inst.IsAugmented() inst.IsAugmented()
) { ) {
auto const augs = inst.GetAugmentIDs(); auto const augs = inst.GetAugmentIDs();
std::vector<CharacterParcelsRepository::CharacterParcels> parcels; std::vector<CharacterParcelsRepository::CharacterParcels> parcels;
for (auto const &item_id: augs) { int32 next_slot = FindNextFreeParcelSlotUsingMemory();
if (!item_id) { for (auto const &item_id: augs) {
continue; if (!item_id) {
} continue;
}
CharacterParcelsRepository::CharacterParcels p{}; if (next_slot == INVALID_INDEX) {
p.char_id = CharacterID(); break;
p.from_name = "Evolving Item Sub-System"; }
p.note = fmt::format(
"System automatically removed from {} which recently evolved.", CharacterParcelsRepository::CharacterParcels p{};
inst.GetItem()->Name p.char_id = CharacterID();
); p.from_name = "Evolving Item Sub-System";
p.slot_id = FindNextFreeParcelSlotUsingMemory(); p.note = fmt::format(
p.sent_date = time(nullptr); "System automatically removed from {} which recently evolved.",
p.item_id = item_id; inst.GetItem()->Name
p.quantity = 1; );
p.slot_id = next_slot;
p.sent_date = time(nullptr);
p.item_id = item_id;
p.quantity = 1;
if (player_event_logs.IsEventEnabled(PlayerEvent::PARCEL_SEND)) { if (player_event_logs.IsEventEnabled(PlayerEvent::PARCEL_SEND)) {
PlayerEvent::ParcelSend e{}; PlayerEvent::ParcelSend e{};
@@ -367,8 +372,10 @@ bool Client::DoEvolveCheckProgression(EQ::ItemInstance &inst)
RecordPlayerEventLog(PlayerEvent::PARCEL_SEND, e); RecordPlayerEventLog(PlayerEvent::PARCEL_SEND, e);
} }
parcels.push_back(p); parcels.push_back(p);
} m_parcels.emplace(p.slot_id, p);
next_slot = FindNextFreeParcelSlotUsingMemory();
}
CharacterParcelsRepository::InsertMany(database, parcels); CharacterParcelsRepository::InsertMany(database, parcels);
SendParcelStatus(); SendParcelStatus();