Skip to content

Commit

Permalink
Merge pull request #6395 from CatsAndBoats/core-logging-bazaar-vendor…
Browse files Browse the repository at this point in the history
…-gil

Core: Enhancements to logging Bazaar and Vendor transactions
  • Loading branch information
zach2good authored Nov 3, 2024
2 parents 0d5d2a3 + 8932cc7 commit 9398a3d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/map/packet_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5052,9 +5052,11 @@ void SmallPacket0x085(map_session_data_t* const PSession, CCharEntity* const PCh
return;
}

charutils::UpdateItem(PChar, LOC_INVENTORY, 0, quantity * PItem->getBasePrice());
const auto cost = quantity * PItem->getBasePrice();

charutils::UpdateItem(PChar, LOC_INVENTORY, 0, cost);
charutils::UpdateItem(PChar, LOC_INVENTORY, slotID, -(int32)quantity);
ShowInfo("SmallPacket0x085: Player '%s' sold %u of itemID %u [to VENDOR] ", PChar->getName(), quantity, itemID);
ShowInfo("SmallPacket0x085: Player '%s' sold %u of itemID %u (Total: %u gil) [to VENDOR] ", PChar->getName(), quantity, itemID, cost);
PChar->pushPacket(new CMessageStandardPacket(nullptr, itemID, quantity, MsgStd::Sell));
PChar->pushPacket(new CInventoryFinishPacket());
PChar->Container->setItem(PChar->Container->getSize() - 1, 0, -1, 0);
Expand Down Expand Up @@ -7982,7 +7984,7 @@ void SmallPacket0x106(map_session_data_t* const PSession, CCharEntity* const PCh
PTarget->pushPacket(new CInventoryItemPacket(PBazaar->GetItem(SlotID), LOC_INVENTORY, SlotID));
PTarget->pushPacket(new CInventoryFinishPacket());

DebugBazaarsFmt("Bazaar Interaction [Purchase Successful] - Buyer: {}, Seller: {}, Item: {}, Qty: {}", PChar->name, PTarget->name, PItem->getName(), Quantity);
DebugBazaarsFmt("Bazaar Interaction [Purchase Successful] - Buyer: {}, Seller: {}, Item: {}, Qty: {}, Cost: {}", PChar->name, PTarget->name, PItem->getName(), Quantity, PriceWithTax);

bool BazaarIsEmpty = true;

Expand Down

0 comments on commit 9398a3d

Please sign in to comment.