mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
[Fix] Add price change check to the Bazaar Search Window purchase mechanics (#4632)
This commit is contained in:
+4
-1
@@ -1106,6 +1106,7 @@ void Client::TraderStartTrader(const EQApplicationPacket *app)
|
||||
trader_item.item_id = inst->GetID();
|
||||
trader_item.item_sn = in->serial_number[i];
|
||||
trader_item.slot_id = i;
|
||||
trader_item.listing_date = time(nullptr);
|
||||
if (inst->IsAugmented()) {
|
||||
auto augs = inst->GetAugmentIDs();
|
||||
trader_item.aug_slot_1 = augs.at(0);
|
||||
@@ -1812,6 +1813,7 @@ void Client::DoBazaarSearch(BazaarSearchCriteria_Struct search_criteria)
|
||||
return;
|
||||
}
|
||||
|
||||
SetTraderTransactionDate();
|
||||
std::stringstream ss{};
|
||||
cereal::BinaryOutputArchive ar(ss);
|
||||
ar(results);
|
||||
@@ -2798,6 +2800,7 @@ void Client::TraderPriceUpdate(const EQApplicationPacket *app)
|
||||
trader_item.item_cost = tpus->NewPrice;
|
||||
trader_item.item_id = newgis->items[i];
|
||||
trader_item.item_sn = newgis->serial_number[i];
|
||||
trader_item.listing_date = time(nullptr);
|
||||
if (item_detail->IsAugmented()) {
|
||||
auto augs = item_detail->GetAugmentIDs();
|
||||
trader_item.aug_slot_1 = augs.at(0);
|
||||
@@ -3072,7 +3075,7 @@ void Client::BuyTraderItemOutsideBazaar(TraderBuy_Struct *tbs, const EQApplicati
|
||||
{
|
||||
auto in = (TraderBuy_Struct *) app->pBuffer;
|
||||
auto trader_item = TraderRepository::GetItemBySerialNumber(database, tbs->serial_number, tbs->trader_id);
|
||||
if (!trader_item.id) {
|
||||
if (!trader_item.id || GetTraderTransactionDate() < trader_item.listing_date) {
|
||||
LogTrading("Attempt to purchase an item outside of the Bazaar trader_id <red>[{}] item serial_number "
|
||||
"<red>[{}] The Traders data was outdated.",
|
||||
tbs->trader_id,
|
||||
|
||||
Reference in New Issue
Block a user