From 9fe21fcd8883b37bdc30224822e6e42afb35b8f0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 7 Feb 2016 16:18:13 +0300 Subject: Replace most static_cast to shorter versions from defines. --- src/net/eathena/playerhandler.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/net/eathena/playerhandler.cpp') diff --git a/src/net/eathena/playerhandler.cpp b/src/net/eathena/playerhandler.cpp index c319c6e8d..c07fa4d13 100644 --- a/src/net/eathena/playerhandler.cpp +++ b/src/net/eathena/playerhandler.cpp @@ -69,7 +69,7 @@ void PlayerHandler::increaseAttribute(const AttributesT attr) const if (attr >= Attributes::STR && attr <= Attributes::LUK) { createOutPacket(CMSG_STAT_UPDATE_REQUEST); - outMsg.writeInt16(static_cast(attr), "attribute id"); + outMsg.writeInt16(CAST_S16(attr), "attribute id"); outMsg.writeInt8(1, "increase"); } } @@ -109,9 +109,9 @@ void PlayerHandler::setDestination(const int x, const int y, const int direction) const { createOutPacket(CMSG_PLAYER_CHANGE_DEST); - outMsg.writeCoordinates(static_cast(x), - static_cast(y), - static_cast(direction), "destination"); + outMsg.writeCoordinates(CAST_U16(x), + CAST_U16(y), + CAST_U8(direction), "destination"); } void PlayerHandler::changeAction(const BeingActionT &action) const @@ -165,10 +165,10 @@ void PlayerHandler::setShortcut(const int idx, const int level) const { createOutPacket(CMSG_SET_SHORTCUTS); - outMsg.writeInt16(static_cast(idx), "index"); - outMsg.writeInt8(static_cast(type), "type"); + outMsg.writeInt16(CAST_S16(idx), "index"); + outMsg.writeInt8(CAST_S8(type), "type"); outMsg.writeInt32(id, "id"); - outMsg.writeInt16(static_cast(level), "level"); + outMsg.writeInt16(CAST_S16(level), "level"); } void PlayerHandler::shortcutShiftRow(const int row) const @@ -176,7 +176,7 @@ void PlayerHandler::shortcutShiftRow(const int row) const if (serverVersion != 0 && serverVersion < 11) return; createOutPacket(CMSG_SHORTCUTS_ROW_SHIFT); - outMsg.writeInt8(static_cast(row), "row"); + outMsg.writeInt8(CAST_S8(row), "row"); } void PlayerHandler::removeOption() const @@ -187,7 +187,7 @@ void PlayerHandler::removeOption() const void PlayerHandler::changeCart(const int type) const { createOutPacket(CMSG_CHANGE_CART); - outMsg.writeInt16(static_cast(type), "type"); + outMsg.writeInt16(CAST_S16(type), "type"); } void PlayerHandler::setMemo() const -- cgit v1.2.3-70-g09d2