From f3db3708b082a885d39c38c42221f37b9c0e0d9d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 17 Sep 2016 16:02:04 +0300 Subject: Show money in vending shop report message. --- src/net/eathena/vendingrecv.cpp | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'src/net') diff --git a/src/net/eathena/vendingrecv.cpp b/src/net/eathena/vendingrecv.cpp index 3419ab343..02b94d64e 100644 --- a/src/net/eathena/vendingrecv.cpp +++ b/src/net/eathena/vendingrecv.cpp @@ -23,6 +23,7 @@ #include "actormanager.h" #include "itemcolormanager.h" #include "notifymanager.h" +#include "units.h" #include "being/localplayer.h" #include "being/playerinfo.h" @@ -220,12 +221,12 @@ void VendingRecv::processReport(Net::MessageIn &msg) { const int index = msg.readInt16("inv index") - INVENTORY_OFFSET; const int amount = msg.readInt16("amount"); + int money = 0; if (msg.getVersion() >= 20141016) { - UNIMPLIMENTEDPACKET; msg.readInt32("char id"); msg.readInt32("time"); - msg.readInt32("zeny"); + money = msg.readInt32("zeny"); } const Inventory *const inventory = PlayerInfo::getCartInventory(); if (!inventory) @@ -235,10 +236,22 @@ void VendingRecv::processReport(Net::MessageIn &msg) return; const ItemInfo &info = item->getInfo(); - // TRANSLATORS: vending sold item message - const std::string str = strprintf(_("Sold item %s amount %d"), - info.getLink().c_str(), - amount); + std::string str; + if (money != 0) + { + // TRANSLATORS: vending sold item message + str = strprintf(_("Sold item %s amount %d. You got: %s"), + info.getLink().c_str(), + amount, + Units::formatCurrency(money).c_str()); + } + else + { + // TRANSLATORS: vending sold item message + str = strprintf(_("Sold item %s amount %d"), + info.getLink().c_str(), + amount); + } NotifyManager::notify(NotifyTypes::VENDING_SOLD_ITEM, str); } -- cgit v1.2.3-70-g09d2