summaryrefslogtreecommitdiff
path: root/src/net/tmwa
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-01-18 14:06:44 +0300
committerAndrei Karas <akaras@inbox.ru>2015-01-18 14:06:44 +0300
commit64309d7a7dc6380d62fa11363073d4243cbfa665 (patch)
treee9ac37f294e2a612391be6afa199b689e90defe8 /src/net/tmwa
parentbc22bc4da27d80627fa966660670219b3652e9ec (diff)
downloadplus-64309d7a7dc6380d62fa11363073d4243cbfa665.tar.gz
plus-64309d7a7dc6380d62fa11363073d4243cbfa665.tar.bz2
plus-64309d7a7dc6380d62fa11363073d4243cbfa665.tar.xz
plus-64309d7a7dc6380d62fa11363073d4243cbfa665.zip
Convert player look variable format from 8 bit to 16 bit.
Diffstat (limited to 'src/net/tmwa')
-rw-r--r--src/net/tmwa/beinghandler.cpp14
-rw-r--r--src/net/tmwa/charserverhandler.cpp6
-rw-r--r--src/net/tmwa/charserverhandler.h2
3 files changed, 11 insertions, 11 deletions
diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp
index 94580279c..05e60b43f 100644
--- a/src/net/tmwa/beinghandler.cpp
+++ b/src/net/tmwa/beinghandler.cpp
@@ -333,7 +333,7 @@ void BeingHandler::processBeingChangeLookContinue(Being *const dstBeing,
break;
case 1: // eAthena LOOK_HAIR
{
- const uint8_t look = static_cast<uint8_t>(id / 256);
+ const uint16_t look = static_cast<uint16_t>(id / 256);
const int hair = id % 256;
dstBeing->setHairStyle(SPRITE_HAIR_COLOR, hair * -1);
dstBeing->setLook(look);
@@ -410,7 +410,7 @@ void BeingHandler::processBeingChangeLookContinue(Being *const dstBeing,
localPlayer->imitateOutfit(dstBeing, SPRITE_EVOL2);
break;
case 16:
- dstBeing->setLook(static_cast<uint8_t>(id));
+ dstBeing->setLook(static_cast<uint16_t>(id));
break;
default:
logger->log("QQQ3 CHANGE_LOOKS: unsupported type: "
@@ -482,7 +482,7 @@ void BeingHandler::processPlayerUpdate1(Net::MessageIn &msg)
dstBeing->setWalkSpeed(Vector(speed, speed, 0));
const uint8_t hairStyle = msg.readUInt8("hair style");
- const uint8_t look = msg.readUInt8("look");
+ const uint16_t look = msg.readUInt8("look");
dstBeing->setSubtype(job, look);
const uint16_t weapon = msg.readInt16("weapon");
const uint16_t shield = msg.readInt16("shield");
@@ -635,7 +635,7 @@ void BeingHandler::processPlayerUpdate2(Net::MessageIn &msg)
dstBeing->setWalkSpeed(Vector(speed, speed, 0));
const uint8_t hairStyle = msg.readUInt8("hair style");
- const uint8_t look = msg.readUInt8("look");
+ const uint16_t look = msg.readUInt8("look");
dstBeing->setSubtype(job, look);
const uint16_t weapon = msg.readInt16("weapon");
const uint16_t shield = msg.readInt16("shield");
@@ -784,7 +784,7 @@ void BeingHandler::processPlayerMove(Net::MessageIn &msg)
dstBeing->setWalkSpeed(Vector(speed, speed, 0));
const uint8_t hairStyle = msg.readUInt8("hair style");
- const uint8_t look = msg.readUInt8("look");
+ const uint16_t look = msg.readUInt8("look");
dstBeing->setSubtype(job, look);
const uint16_t weapon = msg.readInt16("weapon");
const uint16_t shield = msg.readInt16("shield");
@@ -995,7 +995,7 @@ void BeingHandler::processBeingVisible(Net::MessageIn &msg)
speed = 150;
const uint8_t hairStyle = msg.readUInt8("hair style");
- const uint8_t look = msg.readUInt8("look");
+ const uint16_t look = msg.readUInt8("look");
dstBeing->setSubtype(job, look);
if (dstBeing->getType() == ActorType::Monster && localPlayer)
localPlayer->checkNewName(dstBeing);
@@ -1198,7 +1198,7 @@ void BeingHandler::processBeingMove(Net::MessageIn &msg)
speed = 150;
const uint8_t hairStyle = msg.readUInt8("hair style");
- const uint8_t look = msg.readUInt8("look");
+ const uint16_t look = msg.readUInt8("look");
dstBeing->setSubtype(job, look);
if (dstBeing->getType() == ActorType::Monster && localPlayer)
localPlayer->checkNewName(dstBeing);
diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp
index a8815da5b..1b77b950d 100644
--- a/src/net/tmwa/charserverhandler.cpp
+++ b/src/net/tmwa/charserverhandler.cpp
@@ -173,7 +173,7 @@ void CharServerHandler::readPlayerData(Net::MessageIn &msg,
msg.readInt16("speed");
const uint16_t race = msg.readInt16("class");
const uint8_t hairStyle = msg.readUInt8("hair style");
- const uint8_t look = msg.readUInt8("look");
+ const uint16_t look = msg.readUInt8("look");
tempPlayer->setSubtype(race, look);
const uint16_t weapon = msg.readInt16("weapon");
tempPlayer->setSprite(SPRITE_BODY, weapon, "", 1, true);
@@ -272,7 +272,7 @@ void CharServerHandler::newCharacter(const std::string &name, const int slot,
const int hairstyle,
const int hairColor,
const unsigned char race,
- const unsigned char look,
+ const uint16_t look,
const std::vector<int> &stats) const
{
createOutPacket(CMSG_CHAR_CREATE);
@@ -285,7 +285,7 @@ void CharServerHandler::newCharacter(const std::string &name, const int slot,
outMsg.writeInt8(0, "unused");
outMsg.writeInt8(static_cast<int8_t>(hairstyle), "hair style");
if (serverFeatures->haveLookSelection())
- outMsg.writeInt8(look, "look");
+ outMsg.writeInt8(static_cast<int8_t>(look), "look");
else
outMsg.writeInt8(0, "unused");
if (serverFeatures->haveRaceSelection())
diff --git a/src/net/tmwa/charserverhandler.h b/src/net/tmwa/charserverhandler.h
index 0e4803b6c..509d82c0c 100644
--- a/src/net/tmwa/charserverhandler.h
+++ b/src/net/tmwa/charserverhandler.h
@@ -51,7 +51,7 @@ class CharServerHandler final : public MessageHandler,
const int hairstyle,
const int hairColor,
const unsigned char race,
- const unsigned char look,
+ const uint16_t look,
const std::vector<int> &stats) const override final;
void deleteCharacter(Net::Character *const character,