From 98d5d99550b7f4c76da6a7ac2b8a21c8ba6cfa62 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 1 Mar 2011 03:50:27 +0200 Subject: Add support for reading colors in moveing players packets. --- src/net/tmwa/beinghandler.cpp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'src/net') diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp index 15792cf3a..9c5c45185 100644 --- a/src/net/tmwa/beinghandler.cpp +++ b/src/net/tmwa/beinghandler.cpp @@ -167,6 +167,7 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) Being *srcBeing, *dstBeing; int hairStyle, hairColor, flag; int hp, maxHP, oldHP; + unsigned char colors[9]; switch (msg.getId()) { @@ -876,8 +877,17 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) headTop = msg.readInt16(); headMid = msg.readInt16(); hairColor = msg.readInt16(); - shoes = msg.readInt16(); - gloves = msg.readInt16(); //sd->head_dir + + colors[0] = msg.readInt8(); + colors[1] = msg.readInt8(); + colors[2] = msg.readInt8(); + logger->log("msg: %x", msg.getId()); + logger->log("colors: %d, %d, %d", colors[0], colors[1], colors[2]); + + msg.readInt8(); //unused +// shoes = msg.readInt16(); +// gloves = msg.readInt16(); //sd->head_dir + guild = msg.readInt32(); // guild if (guild == 0) @@ -897,9 +907,10 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) if (!config.getBoolValue("hideShield")) dstBeing->setSprite(SPRITE_SHIELD, shield); //dstBeing->setSprite(SPRITE_SHOE, shoes); - dstBeing->setSprite(SPRITE_BOTTOMCLOTHES, headBottom); - dstBeing->setSprite(SPRITE_TOPCLOTHES, headMid); - dstBeing->setSprite(SPRITE_HAT, headTop); + logger->log("bmt: %d, %d, %d", colors[0], colors[2], colors[1]); + dstBeing->setSprite(SPRITE_BOTTOMCLOTHES, headBottom, "", colors[0]); + dstBeing->setSprite(SPRITE_TOPCLOTHES, headMid, "", colors[2]); + dstBeing->setSprite(SPRITE_HAT, headTop, "", colors[1]); //dstBeing->setSprite(SPRITE_GLOVES, gloves); //dstBeing->setSprite(SPRITE_CAPE, cape); //dstBeing->setSprite(SPRITE_MISC1, misc1); -- cgit v1.2.3-70-g09d2