summaryrefslogtreecommitdiff
path: root/src/net/tmwa/npchandler.cpp
diff options
context:
space:
mode:
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_)