From f4792bc06f21335fc2d1171d937ea7645ca0c253 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 18 Mar 2011 22:13:37 +0200 Subject: Fix most conversions except manaserv net code and some other code. --- src/net/tmwa/npchandler.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/net/tmwa/npchandler.cpp') diff --git a/src/net/tmwa/npchandler.cpp b/src/net/tmwa/npchandler.cpp index f085da68c..f70e8cd03 100644 --- a/src/net/tmwa/npchandler.cpp +++ b/src/net/tmwa/npchandler.cpp @@ -189,9 +189,9 @@ void NpcHandler::integerInput(int npcId, int value) void NpcHandler::stringInput(int npcId, const std::string &value) { MessageOut outMsg(CMSG_NPC_STR_RESPONSE); - outMsg.writeInt16(value.length() + 9); + outMsg.writeInt16(static_cast(value.length() + 9)); outMsg.writeInt32(npcId); - outMsg.writeString(value, value.length()); + outMsg.writeString(value, static_cast(value.length())); outMsg.writeInt8(0); // Prevent problems with string reading } @@ -228,16 +228,16 @@ void NpcHandler::buyItem(int beingId _UNUSED_, int itemId, if (serverVersion > 0) { outMsg.writeInt16(10); // One item (length of packet) - outMsg.writeInt16(amount); - outMsg.writeInt16(itemId); + outMsg.writeInt16(static_cast(amount)); + outMsg.writeInt16(static_cast(itemId)); outMsg.writeInt8(color); outMsg.writeInt8(0); } else { outMsg.writeInt16(8); // One item (length of packet) - outMsg.writeInt16(amount); - outMsg.writeInt16(itemId); + outMsg.writeInt16(static_cast(amount)); + outMsg.writeInt16(static_cast(itemId)); } } @@ -245,8 +245,8 @@ void NpcHandler::sellItem(int beingId _UNUSED_, int itemId, int amount) { MessageOut outMsg(CMSG_NPC_SELL_REQUEST); outMsg.writeInt16(8); // One item (length of packet) - outMsg.writeInt16(itemId + INVENTORY_OFFSET); - outMsg.writeInt16(amount); + outMsg.writeInt16(static_cast(itemId + INVENTORY_OFFSET)); + outMsg.writeInt16(static_cast(amount)); } void NpcHandler::endShopping(int beingId _UNUSED_) -- cgit v1.2.3-70-g09d2