diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/common/manaserv_protocol.h | 6 | ||||
-rw-r--r-- | src/game-server/state.cpp | 15 |
2 files changed, 8 insertions, 13 deletions
diff --git a/src/common/manaserv_protocol.h b/src/common/manaserv_protocol.h index 73ea5932..50bfdd84 100644 --- a/src/common/manaserv_protocol.h +++ b/src/common/manaserv_protocol.h @@ -29,8 +29,8 @@ namespace ManaServ { enum { - PROTOCOL_VERSION = 5, - SUPPORTED_DB_VERSION = 24 + PROTOCOL_VERSION = 6, + SUPPORTED_DB_VERSION = 25 }; /** @@ -130,7 +130,7 @@ enum { // npc: W type id GPMSG_BEING_LEAVE = 0x0201, // W being id GPMSG_ITEM_APPEAR = 0x0202, // W item id, W*2 position - GPMSG_BEING_LOOKS_CHANGE = 0x0210, // B sprite layers changed, { B slot type, W item id }* + GPMSG_BEING_LOOKS_CHANGE = 0x0210, // B hairstyle, B haircolor, B sprite layers changed, { B slot type, W item id }* GPMSG_BEING_EMOTE = 0x0211, // W being id, W emote id PGMSG_BEING_EMOTE = 0x0212, // W emoticon id PGMSG_WALK = 0x0260, // W*2 destination diff --git a/src/game-server/state.cpp b/src/game-server/state.cpp index 3bed559f..a7cac98c 100644 --- a/src/game-server/state.cpp +++ b/src/game-server/state.cpp @@ -80,8 +80,11 @@ static std::map< std::string, std::string > mScriptVariables; */ static void serializeLooks(Entity *ch, MessageOut &msg) { - const EquipData &equipData = ch->getComponent<CharacterComponent>() - ->getPossessions().getEquipment(); + auto *characterComponent = ch->getComponent<CharacterComponent>(); + msg.writeInt8(characterComponent->getHairStyle()); + msg.writeInt8(characterComponent->getHairColor()); + const EquipData &equipData = + characterComponent->getPossessions().getEquipment(); // We'll use a set to check whether we already sent the update for the given // item instance. @@ -180,12 +183,6 @@ static void informPlayer(MapComposite *map, Entity *p) MessageOut LooksMsg(GPMSG_BEING_LOOKS_CHANGE); LooksMsg.writeInt16(oid); serializeLooks(o, LooksMsg); - auto *characterComponent = - o->getComponent<CharacterComponent>(); - LooksMsg.writeInt16(characterComponent->getHairStyle()); - LooksMsg.writeInt16(characterComponent->getHairColor()); - LooksMsg.writeInt16( - o->getComponent<BeingComponent>()->getGender()); gameHandler->sendTo(p, LooksMsg); } @@ -286,8 +283,6 @@ static void informPlayer(MapComposite *map, Entity *p) o->getComponent<CharacterComponent>(); enterMsg.writeString( o->getComponent<BeingComponent>()->getName()); - enterMsg.writeInt8(characterComponent->getHairStyle()); - enterMsg.writeInt8(characterComponent->getHairColor()); serializeLooks(o, enterMsg); } break; |