diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-02-07 16:18:13 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-02-07 16:18:13 +0300 |
commit | 9fe21fcd8883b37bdc30224822e6e42afb35b8f0 (patch) | |
tree | 798117abd4dc7e610997d59d530a96ddc1509f53 /src/net/eathena/playerhandler.cpp | |
parent | 4429cb14e9e187edef27aba692a4266733f79c17 (diff) | |
download | mv-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.gz mv-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.bz2 mv-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.xz mv-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.zip |
Replace most static_cast<Type> to shorter versions from defines.
Diffstat (limited to 'src/net/eathena/playerhandler.cpp')
-rw-r--r-- | src/net/eathena/playerhandler.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
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<int16_t>(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<uint16_t>(x), - static_cast<uint16_t>(y), - static_cast<unsigned char>(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<int16_t>(idx), "index"); - outMsg.writeInt8(static_cast<int8_t>(type), "type"); + outMsg.writeInt16(CAST_S16(idx), "index"); + outMsg.writeInt8(CAST_S8(type), "type"); outMsg.writeInt32(id, "id"); - outMsg.writeInt16(static_cast<int16_t>(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<int8_t>(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<int16_t>(type), "type"); + outMsg.writeInt16(CAST_S16(type), "type"); } void PlayerHandler::setMemo() const |