summaryrefslogtreecommitdiff
path: root/src/net/eathena/vendinghandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-29 14:30:20 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-29 14:30:20 +0300
commit0f9ec2061c4ad6157c3186f1cab9c4d8558980b5 (patch)
tree6259593b8436178ad8d981a96a8fd71eab9e04cc /src/net/eathena/vendinghandler.cpp
parent01773c71a4698c6f01fe70d864f922bda65506cb (diff)
downloadplus-0f9ec2061c4ad6157c3186f1cab9c4d8558980b5.tar.gz
plus-0f9ec2061c4ad6157c3186f1cab9c4d8558980b5.tar.bz2
plus-0f9ec2061c4ad6157c3186f1cab9c4d8558980b5.tar.xz
plus-0f9ec2061c4ad6157c3186f1cab9c4d8558980b5.zip
Add strong typed int type BeingId.
Diffstat (limited to 'src/net/eathena/vendinghandler.cpp')
-rw-r--r--src/net/eathena/vendinghandler.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/net/eathena/vendinghandler.cpp b/src/net/eathena/vendinghandler.cpp
index 9ba6bfc7b..1bbe491cf 100644
--- a/src/net/eathena/vendinghandler.cpp
+++ b/src/net/eathena/vendinghandler.cpp
@@ -116,7 +116,7 @@ void VendingHandler::processOpenReq(Net::MessageIn &msg)
void VendingHandler::processShowBoard(Net::MessageIn &msg)
{
- const int id = msg.readInt32("owner id");
+ const BeingId id = msg.readBeingId("owner id");
const std::string shopName = msg.readString(80, "shop name");
Being *const dstBeing = actorManager->findBeing(id);
if (dstBeing)
@@ -125,7 +125,7 @@ void VendingHandler::processShowBoard(Net::MessageIn &msg)
void VendingHandler::processHideBoard(Net::MessageIn &msg)
{
- const int id = msg.readInt32("owner id");
+ const BeingId id = msg.readBeingId("owner id");
Being *const dstBeing = actorManager->findBeing(id);
if (dstBeing)
dstBeing->setSellBoard(std::string());
@@ -139,7 +139,7 @@ void VendingHandler::processHideBoard(Net::MessageIn &msg)
void VendingHandler::processItemsList(Net::MessageIn &msg)
{
const int count = (msg.readInt16("len") - 12) / 22;
- const int id = msg.readInt32("id");
+ const BeingId id = msg.readBeingId("id");
Being *const being = actorManager->findBeing(id);
if (!being)
return;
@@ -223,7 +223,7 @@ void VendingHandler::open(const Being *const being) const
return;
createOutPacket(CMSG_VENDING_LIST_REQ);
- outMsg.writeInt32(being->getId(), "account id");
+ outMsg.writeBeingId(being->getId(), "account id");
}
void VendingHandler::buy(const Being *const being,
@@ -235,7 +235,7 @@ void VendingHandler::buy(const Being *const being,
createOutPacket(CMSG_VENDING_BUY);
outMsg.writeInt16(12, "len");
- outMsg.writeInt32(being->getId(), "account id");
+ outMsg.writeBeingId(being->getId(), "account id");
outMsg.writeInt16(static_cast<int16_t>(amount), "amount");
outMsg.writeInt16(static_cast<int16_t>(index), "index");
}
@@ -250,7 +250,7 @@ void VendingHandler::buy2(const Being *const being,
createOutPacket(CMSG_VENDING_BUY2);
outMsg.writeInt16(16, "len");
- outMsg.writeInt32(being->getId(), "account id");
+ outMsg.writeBeingId(being->getId(), "account id");
outMsg.writeInt32(vendId, "vend id");
outMsg.writeInt16(static_cast<int16_t>(amount), "amount");
outMsg.writeInt16(static_cast<int16_t>(index), "index");