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/tmwa/skillhandler.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/net/tmwa/skillhandler.cpp') diff --git a/src/net/tmwa/skillhandler.cpp b/src/net/tmwa/skillhandler.cpp index abd2fd67e..87dc0e189 100644 --- a/src/net/tmwa/skillhandler.cpp +++ b/src/net/tmwa/skillhandler.cpp @@ -42,8 +42,8 @@ void SkillHandler::useBeing(const int id, const int level, const BeingId beingId) const { createOutPacket(CMSG_SKILL_USE_BEING); - outMsg.writeInt16(static_cast(id), "skill id"); - outMsg.writeInt16(static_cast(level), "level"); + outMsg.writeInt16(CAST_S16(id), "skill id"); + outMsg.writeInt16(CAST_S16(level), "level"); outMsg.writeBeingId(beingId, "target id"); } @@ -51,10 +51,10 @@ void SkillHandler::usePos(const int id, const int level, const int x, const int y) const { createOutPacket(CMSG_SKILL_USE_POSITION); - outMsg.writeInt16(static_cast(level), "skill level"); - outMsg.writeInt16(static_cast(id), "skill id"); - outMsg.writeInt16(static_cast(x), "x"); - outMsg.writeInt16(static_cast(y), "y"); + outMsg.writeInt16(CAST_S16(level), "skill level"); + outMsg.writeInt16(CAST_S16(id), "skill id"); + outMsg.writeInt16(CAST_S16(x), "x"); + outMsg.writeInt16(CAST_S16(y), "y"); } void SkillHandler::usePos(const int id, const int level, @@ -62,17 +62,17 @@ void SkillHandler::usePos(const int id, const int level, const std::string &text) const { createOutPacket(CMSG_SKILL_USE_POSITION_MORE); - outMsg.writeInt16(static_cast(level), "skill level"); - outMsg.writeInt16(static_cast(id), "skill id"); - outMsg.writeInt16(static_cast(x), "x"); - outMsg.writeInt16(static_cast(y), "y"); + outMsg.writeInt16(CAST_S16(level), "skill level"); + outMsg.writeInt16(CAST_S16(id), "skill id"); + outMsg.writeInt16(CAST_S16(x), "x"); + outMsg.writeInt16(CAST_S16(y), "y"); outMsg.writeString(text, 80, "text"); } void SkillHandler::useMap(const int id, const std::string &map) const { createOutPacket(CMSG_SKILL_USE_MAP); - outMsg.writeInt16(static_cast(id), "skill id"); + outMsg.writeInt16(CAST_S16(id), "skill id"); outMsg.writeString(map, 16, "map name"); } -- cgit v1.2.3-70-g09d2