summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-09-17 16:02:04 +0300
committerAndrei Karas <akaras@inbox.ru>2016-09-17 16:02:04 +0300
commitf3db3708b082a885d39c38c42221f37b9c0e0d9d (patch)
treeebea46d1bf4c01d20859879bfe7b19c75e70eaf4 /src
parent1bcba7a1365bb2e5b713190c9664902fc11d0752 (diff)
downloadplus-f3db3708b082a885d39c38c42221f37b9c0e0d9d.tar.gz
plus-f3db3708b082a885d39c38c42221f37b9c0e0d9d.tar.bz2
plus-f3db3708b082a885d39c38c42221f37b9c0e0d9d.tar.xz
plus-f3db3708b082a885d39c38c42221f37b9c0e0d9d.zip
Show money in vending shop report message.
Diffstat (limited to 'src')
-rw-r--r--src/net/eathena/vendingrecv.cpp25
1 files changed, 19 insertions, 6 deletions
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);
}