diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-06-11 00:02:37 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-06-11 01:14:28 +0300 |
commit | 78d804ba1751134120caca22f0cf5abcfd11f29d (patch) | |
tree | 6be477ca42a3e54861a21f121b5581af7058e409 /src/net | |
parent | 3a28edfb7ac991ad70a7baf76f48218d9db89bcb (diff) | |
download | mv-78d804ba1751134120caca22f0cf5abcfd11f29d.tar.gz mv-78d804ba1751134120caca22f0cf5abcfd11f29d.tar.bz2 mv-78d804ba1751134120caca22f0cf5abcfd11f29d.tar.xz mv-78d804ba1751134120caca22f0cf5abcfd11f29d.zip |
Fix compilation for manaserv.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/manaserv/beinghandler.cpp | 8 | ||||
-rw-r--r-- | src/net/manaserv/charhandler.cpp | 6 |
2 files changed, 11 insertions, 3 deletions
diff --git a/src/net/manaserv/beinghandler.cpp b/src/net/manaserv/beinghandler.cpp index 9468baaa1..9f6c2ba2c 100644 --- a/src/net/manaserv/beinghandler.cpp +++ b/src/net/manaserv/beinghandler.cpp @@ -39,6 +39,8 @@ #include "net/manaserv/protocol.h" #include "resources/colordb.h" +#include "resources/itemdb.h" +#include "resources/iteminfo.h" #include "utils/gettext.h" @@ -185,7 +187,8 @@ void BeingHandler::handleBeingEnterMessage(Net::MessageIn &msg) being->setName(name); } int hs = msg.readInt8(), hc = msg.readInt8(); - being->setSprite(SPRITE_HAIR, hs * -1, ColorDB::getHairColor(hc)); + const ItemInfo &item = ItemDB::get(-hs); + being->setSprite(SPRITE_HAIR, hs * -1, item.getDyeColorsString(hc)); being->setGender(msg.readInt8() == GENDER_MALE ? GENDER_MALE : GENDER_FEMALE); handleLooks(being, msg); @@ -351,8 +354,9 @@ void BeingHandler::handleBeingLooksChangeMessage(Net::MessageIn &msg) { int style = msg.readInt16(); int color = msg.readInt16(); + const ItemInfo &item = ItemDB::get(-style); being->setSprite(SPRITE_HAIR, style * -1, - ColorDB::getHairColor(color)); + item.getDyeColorsString(color)); } } diff --git a/src/net/manaserv/charhandler.cpp b/src/net/manaserv/charhandler.cpp index 7977df909..db2d03247 100644 --- a/src/net/manaserv/charhandler.cpp +++ b/src/net/manaserv/charhandler.cpp @@ -41,6 +41,8 @@ #include "net/manaserv/attributes.h" #include "resources/colordb.h" +#include "resources/itemdb.h" +#include "resources/iteminfo.h" #include "utils/dtor.h" #include "utils/gettext.h" @@ -376,8 +378,10 @@ void CharHandler::updateCharacters() LocalPlayer *player = character->dummy = new LocalPlayer; player->setName(info.name); player->setGender(info.gender); + + const ItemInfo &item = ItemDB::get(-info.hairStyle); player->setSprite(SPRITE_HAIR, info.hairStyle * -1, - ColorDB::getHairColor(info.hairColor)); + item.getDyeColorsString(info.hairColor)); character->data.mAttributes[LEVEL] = info.level; character->data.mAttributes[CHAR_POINTS] = info.characterPoints; character->data.mAttributes[CORR_POINTS] = info.correctionPoints; |