mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-19 19:12:26 +00:00
Enhance quantity validation for stackable items
Added handling for zero/negative quantity purchases for stackable items.
This commit is contained in:
parent
7c026ab25c
commit
5bedbc18c4
@ -2947,6 +2947,20 @@ void Client::BuyTraderItemOutsideBazaar(TraderBuy_Struct *tbs, const EQApplicati
|
|||||||
else {
|
else {
|
||||||
charges = buy_item->GetCharges();
|
charges = buy_item->GetCharges();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (charges <= 0) {
|
||||||
|
LogTrading("Rejecting purchase with zero/negative quantity [{}] for stackable item [{}]",
|
||||||
|
charges, buy_item->GetItem()->Name);
|
||||||
|
in->method = BazaarByParcel;
|
||||||
|
in->sub_action = Failed;
|
||||||
|
TraderRepository::UpdateActiveTransaction(database, trader_item.id, false);
|
||||||
|
TradeRequestFailed(app);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (charges > trader_item.item_charges) {
|
||||||
|
charges = trader_item.item_charges;
|
||||||
|
}
|
||||||
|
tbs->quantity = static_cast<uint32>(charges);
|
||||||
}
|
}
|
||||||
|
|
||||||
LogTrading(
|
LogTrading(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user