diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-08-13 17:30:59 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-08-13 17:33:08 -0600 |
commit | f46cfb91278b27f4943f5512778129fe985c678e (patch) | |
tree | 0be219d66e723bcca8de2d584d66bc65d040fb26 /src/net/tmwserv/beinghandler.cpp | |
parent | be85ca9d91ff867faf140328d0bcbb2062b58cdf (diff) | |
download | mana-client-f46cfb91278b27f4943f5512778129fe985c678e.tar.gz mana-client-f46cfb91278b27f4943f5512778129fe985c678e.tar.bz2 mana-client-f46cfb91278b27f4943f5512778129fe985c678e.tar.xz mana-client-f46cfb91278b27f4943f5512778129fe985c678e.zip |
Clean up Being and it's derivatives
Move stuff only needed for Players into Player (like slots and sprite
limits). Move name handling into Being (no need for three copies of
this code). Clean up terminology (including Map terminology). Remove
hair-related variables.
Diffstat (limited to 'src/net/tmwserv/beinghandler.cpp')
-rw-r--r-- | src/net/tmwserv/beinghandler.cpp | 11 |
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)); } } |