mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-05 20:22:28 +00:00
Fix parcel slot duplication for evolving item augments
This commit is contained in:
parent
fb0747fe02
commit
10840753b0
@ -337,24 +337,29 @@ bool Client::DoEvolveCheckProgression(EQ::ItemInstance &inst)
|
||||
!RuleB(EvolvingItems, DestroyAugmentsOnEvolve) &&
|
||||
inst.IsAugmented()
|
||||
) {
|
||||
auto const augs = inst.GetAugmentIDs();
|
||||
std::vector<CharacterParcelsRepository::CharacterParcels> parcels;
|
||||
for (auto const &item_id: augs) {
|
||||
if (!item_id) {
|
||||
continue;
|
||||
}
|
||||
auto const augs = inst.GetAugmentIDs();
|
||||
std::vector<CharacterParcelsRepository::CharacterParcels> parcels;
|
||||
int32 next_slot = FindNextFreeParcelSlotUsingMemory();
|
||||
for (auto const &item_id: augs) {
|
||||
if (!item_id) {
|
||||
continue;
|
||||
}
|
||||
|
||||
CharacterParcelsRepository::CharacterParcels p{};
|
||||
p.char_id = CharacterID();
|
||||
p.from_name = "Evolving Item Sub-System";
|
||||
p.note = fmt::format(
|
||||
"System automatically removed from {} which recently evolved.",
|
||||
inst.GetItem()->Name
|
||||
);
|
||||
p.slot_id = FindNextFreeParcelSlotUsingMemory();
|
||||
p.sent_date = time(nullptr);
|
||||
p.item_id = item_id;
|
||||
p.quantity = 1;
|
||||
if (next_slot == INVALID_INDEX) {
|
||||
break;
|
||||
}
|
||||
|
||||
CharacterParcelsRepository::CharacterParcels p{};
|
||||
p.char_id = CharacterID();
|
||||
p.from_name = "Evolving Item Sub-System";
|
||||
p.note = fmt::format(
|
||||
"System automatically removed from {} which recently evolved.",
|
||||
inst.GetItem()->Name
|
||||
);
|
||||
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)) {
|
||||
PlayerEvent::ParcelSend e{};
|
||||
@ -367,8 +372,10 @@ bool Client::DoEvolveCheckProgression(EQ::ItemInstance &inst)
|
||||
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);
|
||||
SendParcelStatus();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user