summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Schilling <ablu.erikschilling@googlemail.com>2012-10-11 20:12:07 +0200
committerErik Schilling <ablu.erikschilling@googlemail.com>2012-10-11 20:26:15 +0200
commitacaab21e301cb91b1098db311bdd9ce66ab678dd (patch)
tree445c7134c3fd162177a03d490d426bee9547eeb9
parent03a14c66c3ad45cc6fed417a78e9f4648f1df073 (diff)
downloadmana-acaab21e301cb91b1098db311bdd9ce66ab678dd.tar.gz
mana-acaab21e301cb91b1098db311bdd9ce66ab678dd.tar.bz2
mana-acaab21e301cb91b1098db311bdd9ce66ab678dd.tar.xz
mana-acaab21e301cb91b1098db311bdd9ce66ab678dd.zip
Client side patch for change of sending order of gender
Reviewed-by: Stefan Beller.
-rw-r--r--src/net/manaserv/beinghandler.cpp13
-rw-r--r--src/net/manaserv/manaserv_protocol.h8
2 files changed, 13 insertions, 8 deletions
diff --git a/src/net/manaserv/beinghandler.cpp b/src/net/manaserv/beinghandler.cpp
index b744e53c..52f6dab4 100644
--- a/src/net/manaserv/beinghandler.cpp
+++ b/src/net/manaserv/beinghandler.cpp
@@ -117,6 +117,14 @@ void BeingHandler::handleBeingEnterMessage(MessageIn &msg)
int px = msg.readInt16();
int py = msg.readInt16();
BeingDirection direction = (BeingDirection)msg.readInt8();
+ Gender gender;
+ int genderAsInt = msg.readInt8();
+ if (genderAsInt == ::GENDER_FEMALE)
+ gender = ::GENDER_FEMALE;
+ else if (genderAsInt == ::GENDER_MALE)
+ gender = ::GENDER_MALE;
+ else
+ gender = ::GENDER_UNSPECIFIED;
Being *being;
switch (type)
@@ -138,8 +146,6 @@ void BeingHandler::handleBeingEnterMessage(MessageIn &msg)
int hs = msg.readInt8(), hc = msg.readInt8();
being->setSprite(SPRITE_LAYER_HAIR, hs * -1,
hairDB.getHairColor(hc));
- being->setGender(msg.readInt8() == ManaServ::GENDER_MALE ?
- ::GENDER_MALE : ::GENDER_FEMALE);
handleLooks(being, msg);
} break;
@@ -151,8 +157,6 @@ void BeingHandler::handleBeingEnterMessage(MessageIn &msg)
? ActorSprite::MONSTER : ActorSprite::NPC, subtype);
std::string name = msg.readString();
if (name.length() > 0) being->setName(name);
- being->setGender(msg.readInt8() == ManaServ::GENDER_MALE ?
- ::GENDER_MALE : ::GENDER_FEMALE);
} break;
default:
@@ -163,6 +167,7 @@ void BeingHandler::handleBeingEnterMessage(MessageIn &msg)
being->setDestination(px, py);
being->setDirection(direction);
being->setAction(action);
+ being->setGender(gender);
}
void BeingHandler::handleBeingLeaveMessage(MessageIn &msg)
diff --git a/src/net/manaserv/manaserv_protocol.h b/src/net/manaserv/manaserv_protocol.h
index 0cc4524c..319d7070 100644
--- a/src/net/manaserv/manaserv_protocol.h
+++ b/src/net/manaserv/manaserv_protocol.h
@@ -122,10 +122,10 @@ enum {
PGMSG_LOWER_ATTRIBUTE = 0x0170, // W attribute
GPMSG_LOWER_ATTRIBUTE_RESPONSE = 0x0171, // B error, W attribute
PGMSG_RESPAWN = 0x0180, // -
- GPMSG_BEING_ENTER = 0x0200, // B type, W being id, B action, W*2 position, B direction
- // character: S name, B hair style, B hair color, B gender, B sprite layers changed, { B slot type, W item id }*
- // monster: W type id gender
- // npc: W type id gender
+ GPMSG_BEING_ENTER = 0x0200, // B type, W being id, B action, W*2 position, B direction, B gender
+ // character: S name, B hair style, B hair color, B sprite layers changed, { B slot type, W item id }*
+ // monster: W type id
+ // 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 }*