[Fix] Corrected issue with bazaar purchase via parcels where an incorrect quantity would be calculated. (#4352)

This commit is contained in:
Mitch Freeman 2024-05-27 18:06:30 -03:00 committed by GitHub
parent 992a5cc132
commit d810cb02c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 6 deletions

View File

@ -3555,6 +3555,17 @@ void Client::BuyTraderItemOutsideBazaar(TraderBuy_Struct *tbs, const EQApplicati
ps.item_slot = parcel_out.slot_id;
strn0cpy(ps.send_to, GetCleanName(), sizeof(ps.send_to));
if (trader_item.item_charges == tbs->quantity) {
TraderRepository::DeleteOne(database, trader_item.id);
} else {
TraderRepository::UpdateQuantity(
database,
trader_item.char_id,
trader_item.item_sn,
trader_item.item_charges - tbs->quantity
);
}
SendParcelDeliveryToWorld(ps);
if (RuleB(Bazaar, AuditTrail)) {

View File

@ -3974,12 +3974,6 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
data->price = in->trader_buy_struct.price * in->trader_buy_struct.quantity;
}
TraderRepository::UpdateQuantity(
database,
trader_pc->CharacterID(),
item_sn,
in->item_quantity_available - in->trader_buy_struct.quantity
);
TraderRepository::UpdateActiveTransaction(database, in->id, false);
trader_pc->RemoveItemBySerialNumber(item_sn, in->trader_buy_struct.quantity);