diff options
Diffstat (limited to 'src/net/eathena/cashshoprecv.cpp')
-rw-r--r-- | src/net/eathena/cashshoprecv.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/net/eathena/cashshoprecv.cpp b/src/net/eathena/cashshoprecv.cpp index e051f8ba0..fefe422f1 100644 --- a/src/net/eathena/cashshoprecv.cpp +++ b/src/net/eathena/cashshoprecv.cpp @@ -24,6 +24,8 @@ #include "being/playerinfo.h" +#include "const/resources/currency.h" + #include "enums/resources/notifytypes.h" #include "gui/windows/buydialog.h" @@ -32,6 +34,12 @@ #include "net/messagein.h" +#include "net/eathena/npcrecv.h" + +#include "resources/beinginfo.h" + +#include "resources/db/npcdb.h" + #include "debug.h" extern int packetVersion; @@ -52,7 +60,24 @@ void CashShopRecv::processCashShopOpen(Net::MessageIn &msg) else count = (msg.readInt16("len") - 8) / 11; - CREATEWIDGETV(mBuyDialog, BuyDialog, fromInt(BuyDialog::Cash, BeingId)); + const BeingTypeId npcId = NpcRecv::mNpcTypeId; + std::string currency; + + if (npcId != BeingTypeId_zero) + { + const BeingInfo *info = NPCDB::get(npcId); + if (info) + currency = info->getCurrency(); + else + currency = DEFAULT_CURRENCY; + } + else + { + currency = DEFAULT_CURRENCY; + } + CREATEWIDGETV(mBuyDialog, BuyDialog, + fromInt(BuyDialog::Cash, BeingId), + currency); const int points = msg.readInt32("cash points"); mBuyDialog->setMoney(points); |