diff options
author | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-10-18 19:00:38 +0000 |
---|---|---|
committer | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-10-18 19:00:38 +0000 |
commit | 54ac35bc5a1484757efeae9b342469b9a00fe2a2 (patch) | |
tree | 73917e6a43f0a90a9f25aaaad24c214c37bf52c4 /src/net/beinghandler.cpp | |
parent | 03b2efa5973db10c3e6366aa0bd2990eee60d8b9 (diff) | |
download | mana-54ac35bc5a1484757efeae9b342469b9a00fe2a2.tar.gz mana-54ac35bc5a1484757efeae9b342469b9a00fe2a2.tar.bz2 mana-54ac35bc5a1484757efeae9b342469b9a00fe2a2.tar.xz mana-54ac35bc5a1484757efeae9b342469b9a00fe2a2.zip |
Removed player looks from generic beings. Prevented client termination on missing sprites. Merged weapon-type and attack-type fields for items.
Diffstat (limited to 'src/net/beinghandler.cpp')
-rw-r--r-- | src/net/beinghandler.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp index 020d24af..6bd31c9f 100644 --- a/src/net/beinghandler.cpp +++ b/src/net/beinghandler.cpp @@ -418,7 +418,7 @@ void BeingHandler::handleMessage(MessageIn &msg) } } -static void handleLooks(Being *being, MessageIn &msg) +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; @@ -471,10 +471,11 @@ BeingHandler::handleBeingEnterMessage(MessageIn &msg) being = beingManager->createBeing(id, type, 0); being->setName(name); } - being->setHairStyle(msg.readByte()); - being->setHairColor(msg.readByte()); - being->setSex(msg.readByte()); - handleLooks(being, msg); + Player *p = static_cast< Player * >(being); + p->setHairStyle(msg.readByte()); + p->setHairColor(msg.readByte()); + p->setGender(msg.readByte()); + handleLooks(p, msg); } break; case OBJECT_MONSTER: @@ -591,7 +592,7 @@ void BeingHandler::handleBeingActionChangeMessage(MessageIn &msg) void BeingHandler::handleBeingLooksChangeMessage(MessageIn &msg) { Being *being = beingManager->findBeing(msg.readShort()); - if (!being) return; - handleLooks(being, msg); + if (!being || being->getType() != Being::PLAYER) return; + handleLooks(static_cast< Player * >(being), msg); } |