summaryrefslogtreecommitdiff
path: root/src/net/tmwa/npchandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-03-18 22:13:37 +0200
committerAndrei Karas <akaras@inbox.ru>2011-03-18 22:13:37 +0200
commitf4792bc06f21335fc2d1171d937ea7645ca0c253 (patch)
treec7b11cf81f254f5b9ed2f5dbfe127649abc7545a /src/net/tmwa/npchandler.cpp
parentf98d003e354a1792117b7cbc771d1dd91475a156 (diff)
downloadmv-f4792bc06f21335fc2d1171d937ea7645ca0c253.tar.gz
mv-f4792bc06f21335fc2d1171d937ea7645ca0c253.tar.bz2
mv-f4792bc06f21335fc2d1171d937ea7645ca0c253.tar.xz
mv-f4792bc06f21335fc2d1171d937ea7645ca0c253.zip
Fix most conversions except manaserv net code and some other code.
Diffstat (limited to 'src/net/tmwa/npchandler.cpp')
-rw-r--r--src/net/tmwa/npchandler.cpp16
1 files changed, 8 insertions, 8 deletions
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<Sint16>(value.length() + 9));
outMsg.writeInt32(npcId);
- outMsg.writeString(value, value.length());
+ outMsg.writeString(value, static_cast<int>(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<Sint16>(amount));
+ outMsg.writeInt16(static_cast<Sint16>(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<Sint16>(amount));
+ outMsg.writeInt16(static_cast<Sint16>(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<Sint16>(itemId + INVENTORY_OFFSET));
+ outMsg.writeInt16(static_cast<Sint16>(amount));
}
void NpcHandler::endShopping(int beingId _UNUSED_)