summaryrefslogtreecommitdiff
path: root/src/net/tmwserv/beinghandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/tmwserv/beinghandler.cpp')
-rw-r--r--src/net/tmwserv/beinghandler.cpp11
1 files changed, 6 insertions, 5 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));
}
}