summaryrefslogtreecommitdiff
path: root/src/net/beinghandler.cpp
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-07-12 19:39:32 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-07-12 19:39:32 +0000
commit038388c2d1aeab8d653a8129e5ff95b4c83b2f88 (patch)
treeef09cb1870f60195fd316f4f5cf32c0d370035dd /src/net/beinghandler.cpp
parent12357db93c457675381c53caae226c900db07c8d (diff)
downloadmana-038388c2d1aeab8d653a8129e5ff95b4c83b2f88.tar.gz
mana-038388c2d1aeab8d653a8129e5ff95b4c83b2f88.tar.bz2
mana-038388c2d1aeab8d653a8129e5ff95b4c83b2f88.tar.xz
mana-038388c2d1aeab8d653a8129e5ff95b4c83b2f88.zip
Added support for visible equipment.
Diffstat (limited to 'src/net/beinghandler.cpp')
-rw-r--r--src/net/beinghandler.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp
index e88914ac..a6bc7fc3 100644
--- a/src/net/beinghandler.cpp
+++ b/src/net/beinghandler.cpp
@@ -60,6 +60,7 @@ BeingHandler::BeingHandler()
GPMSG_BEINGS_MOVE,
GPMSG_BEINGS_DAMAGE,
GPMSG_BEING_ACTION_CHANGE,
+ GPMSG_BEING_LOOKS_CHANGE,
0
};
handledMessages = _messages;
@@ -96,6 +97,9 @@ void BeingHandler::handleMessage(MessageIn &msg)
case GPMSG_BEING_ACTION_CHANGE:
handleBeingActionChangeMessage(msg);
break;
+ case GPMSG_BEING_LOOKS_CHANGE:
+ handleBeingLooksChangeMessage(msg);
+ break;
/*
case SMSG_BEING_VISIBLE:
@@ -411,6 +415,14 @@ void BeingHandler::handleMessage(MessageIn &msg)
}
}
+static void handleLooks(Being *being, MessageIn &msg)
+{
+ being->setWeapon(msg.readShort());
+ being->setVisibleEquipment(Being::HAT_SPRITE, msg.readShort());
+ being->setVisibleEquipment(Being::TOPCLOTHES_SPRITE, msg.readShort());
+ being->setVisibleEquipment(Being::BOTTOMCLOTHES_SPRITE, msg.readShort());
+}
+
void
BeingHandler::handleBeingEnterMessage(MessageIn &msg)
{
@@ -443,7 +455,9 @@ BeingHandler::handleBeingEnterMessage(MessageIn &msg)
being->mY = py;
being->setDestination(px, py);
being->setAction(action);
+ handleLooks(being, msg);
} break;
+
case OBJECT_MONSTER:
{
int monsterId = msg.readShort();
@@ -546,3 +560,11 @@ void BeingHandler::handleBeingActionChangeMessage(MessageIn &msg)
being->setAction((Being::Action) msg.readByte());
}
+
+void BeingHandler::handleBeingLooksChangeMessage(MessageIn &msg)
+{
+ Being *being = beingManager->findBeing(msg.readShort());
+ if (!being) return;
+ handleLooks(being, msg);
+}
+