summaryrefslogtreecommitdiff
path: root/src/net/eathena/beinghandler.cpp
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/eathena/beinghandler.cpp
parent2c13c60e916768fe09bcfff1d0b568a4c5397a99 (diff)
downloadplus-237449794444d60ecc4a669d78becac5372da723.tar.gz
plus-237449794444d60ecc4a669d78becac5372da723.tar.bz2
plus-237449794444d60ecc4a669d78becac5372da723.tar.xz
plus-237449794444d60ecc4a669d78becac5372da723.zip
Fix code style in net.
Diffstat (limited to 'src/net/eathena/beinghandler.cpp')
-rw-r--r--src/net/eathena/beinghandler.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp
index df25f40cf..efa22e490 100644
--- a/src/net/eathena/beinghandler.cpp
+++ b/src/net/eathena/beinghandler.cpp
@@ -432,7 +432,7 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
const int16_t speed = msg.readInt16();
const uint16_t stunMode = msg.readInt16(); // opt1
uint32_t statusEffects = msg.readInt16(); // opt2
- statusEffects |= (static_cast<uint32_t>(msg.readInt16()))
+ statusEffects |= (static_cast<uint16_t>(msg.readInt16()))
<< 16; // status.options; Aethyra uses this as misc2
const int16_t job = msg.readInt16();
int disguiseId = 0;
@@ -506,7 +506,8 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
dstBeing->setStatusEffectBlock(32, msg.readInt16()); // opt3
msg.readInt8(); // karma
// reserving bit for future usage
- dstBeing->setGender(Being::intToGender(msg.readInt8() & 3));
+ dstBeing->setGender(Being::intToGender(
+ static_cast<uint8_t>(msg.readInt8() & 3)));
if (!disguiseId)
{
@@ -618,8 +619,9 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
dstBeing->setStunMode(stunMode);
dstBeing->setStatusEffectBlock(0, static_cast<uint16_t>(
- (statusEffects >> 16) & 0xffff));
- dstBeing->setStatusEffectBlock(16, statusEffects & 0xffff);
+ (statusEffects >> 16) & 0xffffU));
+ dstBeing->setStatusEffectBlock(16, static_cast<uint16_t>(
+ statusEffects & 0xffffU));
if (msgType == 3 && dstBeing->getType() == Being::PLAYER)
dstBeing->setMoveTime();
@@ -645,7 +647,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
int16_t speed = msg.readInt16();
const uint16_t stunMode = msg.readInt16(); // opt1
uint32_t statusEffects = msg.readInt16(); // opt2
- statusEffects |= (static_cast<uint32_t>(msg.readInt16())) << 16; // option
+ statusEffects |= (static_cast<uint16_t>(msg.readInt16())) << 16; // option
const int16_t job = msg.readInt16(); // class
Being *dstBeing = actorManager->findBeing(id);
@@ -733,7 +735,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
msg.readInt16(); // manner
dstBeing->setStatusEffectBlock(32, msg.readInt16()); // opt3
msg.readInt8(); // karma
- int16_t gender = msg.readInt8();
+ uint8_t gender = msg.readInt8();
if (dstBeing->getType() == ActorSprite::PLAYER)
{
@@ -808,8 +810,9 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
dstBeing->setStunMode(stunMode);
dstBeing->setStatusEffectBlock(0, static_cast<uint16_t>(
- (statusEffects >> 16) & 0xffff));
- dstBeing->setStatusEffectBlock(16, statusEffects & 0xffff);
+ (statusEffects >> 16) & 0xffffU));
+ dstBeing->setStatusEffectBlock(16, static_cast<uint16_t>(
+ statusEffects & 0xffffU));
}
} // namespace EAthena