summaryrefslogtreecommitdiff
path: root/src/net/tmwserv
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/tmwserv')
-rw-r--r--src/net/tmwserv/beinghandler.cpp11
-rw-r--r--src/net/tmwserv/charserverhandler.cpp4
2 files changed, 9 insertions, 6 deletions
diff --git a/src/net/tmwserv/beinghandler.cpp b/src/net/tmwserv/beinghandler.cpp
index acd6b62c..d5092782 100644
--- a/src/net/tmwserv/beinghandler.cpp
+++ b/src/net/tmwserv/beinghandler.cpp
@@ -37,6 +37,8 @@
#include "gui/okdialog.h"
+#include "resources/colordb.h"
+
#include "utils/gettext.h"
#include "net/tmwserv/gameserver/player.h"
@@ -95,8 +97,8 @@ static void handleLooks(Player *being, MessageIn &msg)
// Order of sent slots. Has to be in sync with the server code.
static int const nb_slots = 4;
static int const slots[nb_slots] =
- { Being::WEAPON_SPRITE, Being::HAT_SPRITE, Being::TOPCLOTHES_SPRITE,
- Being::BOTTOMCLOTHES_SPRITE };
+ { Player::WEAPON_SPRITE, Player::HAT_SPRITE, Player::TOPCLOTHES_SPRITE,
+ Player::BOTTOMCLOTHES_SPRITE };
int mask = msg.readInt8();
@@ -144,7 +146,7 @@ void BeingHandler::handleBeingEnterMessage(MessageIn &msg)
}
Player *p = static_cast< Player * >(being);
int hs = msg.readInt8(), hc = msg.readInt8();
- p->setHairStyle(hs, hc);
+ p->setSprite(Player::HAIR_SPRITE, hs * -1, ColorDB::get(hc));
p->setGender(msg.readInt8() == GENDER_MALE ?
GENDER_MALE : GENDER_FEMALE);
handleLooks(p, msg);
@@ -304,8 +306,7 @@ void BeingHandler::handleBeingLooksChangeMessage(MessageIn &msg)
{
int style = msg.readInt16();
int color = msg.readInt16();
- player->setHairStyle(style, color);
- player->setGender((Gender)msg.readInt16());
+ player->setSprite(Player::HAIR_SPRITE, style * -1, ColorDB::get(color));
}
}
diff --git a/src/net/tmwserv/charserverhandler.cpp b/src/net/tmwserv/charserverhandler.cpp
index 0146babb..93181a93 100644
--- a/src/net/tmwserv/charserverhandler.cpp
+++ b/src/net/tmwserv/charserverhandler.cpp
@@ -38,6 +38,8 @@
#include "gui/charcreatedialog.h"
#include "gui/okdialog.h"
+#include "resources/colordb.h"
+
#include "utils/gettext.h"
extern Net::Connection *gameServerConnection;
@@ -229,7 +231,7 @@ LocalPlayer* CharServerHandler::readPlayerData(MessageIn &msg, int &slot)
tempPlayer->setName(msg.readString());
tempPlayer->setGender(msg.readInt8() == GENDER_MALE ? GENDER_MALE : GENDER_FEMALE);
int hs = msg.readInt8(), hc = msg.readInt8();
- tempPlayer->setHairStyle(hs, hc);
+ tempPlayer->setSprite(Player::HAIR_SPRITE, hs * -1, ColorDB::get(hc));
tempPlayer->setLevel(msg.readInt16());
tempPlayer->setCharacterPoints(msg.readInt16());
tempPlayer->setCorrectionPoints(msg.readInt16());