summaryrefslogtreecommitdiff
path: root/src
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
parentbc22bc4da27d80627fa966660670219b3652e9ec (diff)
downloadmv-64309d7a7dc6380d62fa11363073d4243cbfa665.tar.gz
mv-64309d7a7dc6380d62fa11363073d4243cbfa665.tar.bz2
mv-64309d7a7dc6380d62fa11363073d4243cbfa665.tar.xz
mv-64309d7a7dc6380d62fa11363073d4243cbfa665.zip
Convert player look variable format from 8 bit to 16 bit.
Diffstat (limited to 'src')
-rw-r--r--src/being/being.cpp4
-rw-r--r--src/being/being.h8
-rw-r--r--src/net/charserverhandler.h2
-rw-r--r--src/net/eathena/charserverhandler.cpp4
-rw-r--r--src/net/eathena/charserverhandler.h2
-rw-r--r--src/net/tmwa/beinghandler.cpp14
-rw-r--r--src/net/tmwa/charserverhandler.cpp6
-rw-r--r--src/net/tmwa/charserverhandler.h2
8 files changed, 21 insertions, 21 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index 838892119..03e13156c 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -301,7 +301,7 @@ void Being::createSpeechBubble()
mSpeechBubble->postInit();
}
-void Being::setSubtype(const uint16_t subtype, const uint8_t look)
+void Being::setSubtype(const uint16_t subtype, const uint16_t look)
{
if (!mInfo)
return;
@@ -3409,7 +3409,7 @@ void Being::playSfx(const SoundInfo &sound, Being *const being,
BLOCK_END("Being::playSfx")
}
-void Being::setLook(const uint8_t look)
+void Being::setLook(const uint16_t look)
{
if (mType == ActorType::Player)
setSubtype(mSubType, look);
diff --git a/src/being/being.h b/src/being/being.h
index fab70ff8f..e11f36003 100644
--- a/src/being/being.h
+++ b/src/being/being.h
@@ -379,7 +379,7 @@ class Being notfinal : public ActorSprite,
/**
* Set Being's subtype (mostly for view for monsters and NPCs)
*/
- void setSubtype(const uint16_t subtype, const uint8_t look);
+ void setSubtype(const uint16_t subtype, const uint16_t look);
const BeingInfo *getInfo() const A_WARN_UNUSED
{ return mInfo; }
@@ -849,10 +849,10 @@ class Being notfinal : public ActorSprite,
void playSfx(const SoundInfo &sound, Being *const being,
const bool main, const int x, const int y) const;
- uint8_t getLook() const
+ uint16_t getLook() const
{ return mLook; }
- void setLook(const uint8_t look);
+ void setLook(const uint16_t look);
static uint8_t genderToInt(const Gender::Type sex) A_WARN_UNUSED;
@@ -1076,7 +1076,7 @@ class Being notfinal : public ActorSprite,
int mUsageCounter;
int mKarma;
int mManner;
- uint8_t mLook;
+ uint16_t mLook;
unsigned char mHairColor;
bool mErased;
bool mEnemy;
diff --git a/src/net/charserverhandler.h b/src/net/charserverhandler.h
index aec583df2..31077d851 100644
--- a/src/net/charserverhandler.h
+++ b/src/net/charserverhandler.h
@@ -62,7 +62,7 @@ class CharServerHandler notfinal
const int hairstyle,
const int hairColor,
const unsigned char race,
- const unsigned char look,
+ const uint16_t look,
const std::vector<int> &stats) const = 0;
virtual void deleteCharacter(Net::Character *const character,
diff --git a/src/net/eathena/charserverhandler.cpp b/src/net/eathena/charserverhandler.cpp
index 21306b659..8decf9eef 100644
--- a/src/net/eathena/charserverhandler.cpp
+++ b/src/net/eathena/charserverhandler.cpp
@@ -219,7 +219,7 @@ void CharServerHandler::readPlayerData(Net::MessageIn &msg,
ItemDB::get(-hairStyle).getDyeColorsString(
msg.readInt16("hair color")));
- const uint8_t look = msg.readInt16("clothes color");
+ const uint16_t look = msg.readInt16("clothes color");
tempPlayer->setSubtype(race, look);
tempPlayer->setName(msg.readString(24, "name"));
@@ -273,7 +273,7 @@ void CharServerHandler::newCharacter(const std::string &name, const int slot,
const Gender::Type gender,
const int hairstyle, const int hairColor,
const unsigned char race,
- const unsigned char look,
+ const uint16_t look,
const std::vector<int> &stats A_UNUSED)
const
{
diff --git a/src/net/eathena/charserverhandler.h b/src/net/eathena/charserverhandler.h
index a6384cbaa..0b424024a 100644
--- a/src/net/eathena/charserverhandler.h
+++ b/src/net/eathena/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 renameCharacter(const int id,
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,