summaryrefslogtreecommitdiff
path: root/src/net/beinghandler.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2006-11-30 21:01:26 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2006-11-30 21:01:26 +0000
commit30aa32025d3406920330390b97001ade27e4343a (patch)
treee3512dc59c0513c090b3c1af2f3d24e92dae9255 /src/net/beinghandler.cpp
parentc24f9a6ec94e42ae47546c3e93794abb2956d3c1 (diff)
downloadmana-client-30aa32025d3406920330390b97001ade27e4343a.tar.gz
mana-client-30aa32025d3406920330390b97001ade27e4343a.tar.bz2
mana-client-30aa32025d3406920330390b97001ade27e4343a.tar.xz
mana-client-30aa32025d3406920330390b97001ade27e4343a.zip
Some optimizations to setSex, setWeapon and handling of player update messages.
Diffstat (limited to 'src/net/beinghandler.cpp')
-rw-r--r--src/net/beinghandler.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp
index 4fcf2105..67d04ee4 100644
--- a/src/net/beinghandler.cpp
+++ b/src/net/beinghandler.cpp
@@ -62,6 +62,7 @@ void BeingHandler::handleMessage(MessageIn *msg)
{
Uint32 id;
Uint16 job, speed;
+ Uint16 headBottom, headTop, headMid;
Sint16 param1;
Sint8 type;
Being *srcBeing, *dstBeing;
@@ -315,15 +316,15 @@ void BeingHandler::handleMessage(MessageIn *msg)
dstBeing->setHairStyle(msg->readInt16());
dstBeing->setWeaponById(msg->readInt16()); // item id 1
msg->readInt16(); // item id 2
- dstBeing->setVisibleEquipment(3, msg->readInt16()); // head bottom
+ headBottom = msg->readInt16();
if (msg->getId() == SMSG_PLAYER_MOVE)
{
msg->readInt32(); // server tick
}
- dstBeing->setVisibleEquipment(4, msg->readInt16()); // head top
- dstBeing->setVisibleEquipment(5, msg->readInt16()); // head mid
+ headTop = msg->readInt16();
+ headMid = msg->readInt16();
dstBeing->setHairColor(msg->readInt16());
msg->readInt16(); // unknown
msg->readInt16(); // head dir
@@ -332,6 +333,9 @@ void BeingHandler::handleMessage(MessageIn *msg)
msg->readInt16(); // manner
msg->readInt8(); // karma
dstBeing->setSex(1 - msg->readInt8()); // sex
+ dstBeing->setVisibleEquipment(3, headBottom);
+ dstBeing->setVisibleEquipment(4, headTop);
+ dstBeing->setVisibleEquipment(5, headMid);
if (msg->getId() == SMSG_PLAYER_MOVE)
{