summaryrefslogtreecommitdiff
path: root/src/net/tmwa
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-04-30 19:53:09 +0300
committerAndrei Karas <akaras@inbox.ru>2014-04-30 19:53:09 +0300
commit237449794444d60ecc4a669d78becac5372da723 (patch)
tree694f439d43e303065220df02ec5a1df9ea5b57fe /src/net/tmwa
parent2c13c60e916768fe09bcfff1d0b568a4c5397a99 (diff)
downloadmanaplus-237449794444d60ecc4a669d78becac5372da723.tar.gz
manaplus-237449794444d60ecc4a669d78becac5372da723.tar.bz2
manaplus-237449794444d60ecc4a669d78becac5372da723.tar.xz
manaplus-237449794444d60ecc4a669d78becac5372da723.zip
Fix code style in net.
Diffstat (limited to 'src/net/tmwa')
-rw-r--r--src/net/tmwa/beinghandler.cpp10
-rw-r--r--src/net/tmwa/charserverhandler.cpp4
-rw-r--r--src/net/tmwa/messageout.cpp2
3 files changed, 8 insertions, 8 deletions
diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp
index 76efd958e..cd3a2cc15 100644
--- a/src/net/tmwa/beinghandler.cpp
+++ b/src/net/tmwa/beinghandler.cpp
@@ -301,7 +301,7 @@ void BeingHandler::processBeingChangeLook(Net::MessageIn &msg,
break;
case 1: // eAthena LOOK_HAIR
{
- const int look = id / 256;
+ const uint8_t look = static_cast<uint8_t>(id / 256U);
const int hair = id % 256;
dstBeing->setHairStyle(SPRITE_HAIR, hair * -1);
dstBeing->setLook(look);
@@ -378,7 +378,7 @@ void BeingHandler::processBeingChangeLook(Net::MessageIn &msg,
player_node->imitateOutfit(dstBeing, SPRITE_EVOL2);
break;
case 16:
- dstBeing->setLook(id);
+ dstBeing->setLook(static_cast<uint8_t>(id));
break;
default:
logger->log("QQQ3 CHANGE_LOOKS: unsupported type: "
@@ -482,7 +482,7 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
dstBeing->setWalkSpeed(Vector(speed, speed, 0));
const int hairStyle = msg.readInt8();
- const int look = msg.readInt8();
+ const uint8_t look = msg.readInt8();
dstBeing->setSubtype(job, look);
const uint16_t weapon = msg.readInt16();
const uint16_t shield = msg.readInt16();
@@ -657,8 +657,8 @@ void BeingHandler::processBeingMove3(Net::MessageIn &msg)
if (serverVersion < 10)
return;
- static const int dirx[8] = {0, -1, -1, -1, 0, 1, 1, 1};
- static const int diry[8] = {1, 1, 0, -1, -1, -1, 0, 1};
+ static const int16_t dirx[8] = {0, -1, -1, -1, 0, 1, 1, 1};
+ static const int16_t diry[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const int len = msg.readInt16() - 14;
Being *const dstBeing = actorManager->findBeing(msg.readInt32());
diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp
index a245372c5..c4fc9001c 100644
--- a/src/net/tmwa/charserverhandler.cpp
+++ b/src/net/tmwa/charserverhandler.cpp
@@ -157,9 +157,9 @@ void CharServerHandler::readPlayerData(Net::MessageIn &msg,
data.mAttributes[PlayerInfo::MAX_MP] = msg.readInt16();
msg.readInt16(); // speed
- const int race = msg.readInt16(); // class (used for race)
+ const uint16_t race = msg.readInt16(); // class (used for race)
const int hairStyle = msg.readInt8();
- const int look = msg.readInt8();
+ const uint8_t look = msg.readInt8();
tempPlayer->setSubtype(race, look);
const uint16_t weapon = msg.readInt16(); // unused on server. need use?
tempPlayer->setSprite(SPRITE_WEAPON, weapon, "", 1, true);
diff --git a/src/net/tmwa/messageout.cpp b/src/net/tmwa/messageout.cpp
index 8c3ecb5ec..9962e7975 100644
--- a/src/net/tmwa/messageout.cpp
+++ b/src/net/tmwa/messageout.cpp
@@ -85,7 +85,7 @@ void MessageOut::writeInt32(const int32_t value)
#define LOBYTE(w) (static_cast<unsigned char>(w))
#define HIBYTE(w) (static_cast<unsigned char>(( \
-static_cast<uint16_t>(w)) >> 8))
+static_cast<uint16_t>(w)) >> 8U))
void MessageOut::writeCoordinates(const uint16_t x,
const uint16_t y,