From 0f9ec2061c4ad6157c3186f1cab9c4d8558980b5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 29 May 2015 14:30:20 +0300 Subject: Add strong typed int type BeingId. --- src/net/eathena/vendinghandler.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/net/eathena/vendinghandler.cpp') 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(amount), "amount"); outMsg.writeInt16(static_cast(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(amount), "amount"); outMsg.writeInt16(static_cast(index), "index"); -- cgit v1.2.3-70-g09d2