From 2464d9d85019711583ef830c2fdeae8a6772cb53 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 1 Feb 2015 16:29:52 +0300 Subject: Show shop name on players. --- src/net/eathena/vendinghandler.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/net') 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) -- cgit v1.2.3-70-g09d2