summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-02-01 16:29:52 +0300
committerAndrei Karas <akaras@inbox.ru>2015-02-02 00:13:44 +0300
commit2464d9d85019711583ef830c2fdeae8a6772cb53 (patch)
treefd007695db4d5c4a06376c27421a3c5a61e129a3 /src/net
parentb6a0e05498b2b1a64d9b407fb2416dbaa0faf407 (diff)
downloadmv-2464d9d85019711583ef830c2fdeae8a6772cb53.tar.gz
mv-2464d9d85019711583ef830c2fdeae8a6772cb53.tar.bz2
mv-2464d9d85019711583ef830c2fdeae8a6772cb53.tar.xz
mv-2464d9d85019711583ef830c2fdeae8a6772cb53.zip
Show shop name on players.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/eathena/vendinghandler.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/net/eathena/vendinghandler.cpp b/src/net/eathena/vendinghandler.cpp
index 54f1b74c1..ec765d559 100644
--- a/src/net/eathena/vendinghandler.cpp
+++ b/src/net/eathena/vendinghandler.cpp
@@ -20,6 +20,7 @@
#include "net/eathena/vendinghandler.h"
+#include "actormanager.h"
#include "shopitem.h"
#include "being/being.h"
@@ -99,13 +100,19 @@ void VendingHandler::processOpenReq(Net::MessageIn &msg)
void VendingHandler::processShowBoard(Net::MessageIn &msg)
{
- msg.readInt32("owner id");
- msg.readString(80, "shop name");
+ const int id = msg.readInt32("owner id");
+ const std::string shopName = msg.readString(80, "shop name");
+ Being *const dstBeing = actorManager->findBeing(id);
+ if (dstBeing)
+ dstBeing->setBoard(shopName);
}
void VendingHandler::processHideBoard(Net::MessageIn &msg)
{
- msg.readInt32("owner id");
+ const int id = msg.readInt32("owner id");
+ Being *const dstBeing = actorManager->findBeing(id);
+ if (dstBeing)
+ dstBeing->setBoard(std::string());
}
void VendingHandler::processItemsList(Net::MessageIn &msg)