diff options
author | Philipp Sehmisch <tmw@crushnet.org> | 2008-02-22 19:58:29 +0000 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-01-05 20:36:46 -0700 |
commit | b6e7b6c6cb3ea26157e3a78713cc9621dc46b2d7 (patch) | |
tree | 67c3d0552af5661b3847ef7e397771bc101e0c7c /src/net | |
parent | 77db175ceabe8d05665191835d0250a927d93d32 (diff) | |
download | mana-b6e7b6c6cb3ea26157e3a78713cc9621dc46b2d7.tar.gz mana-b6e7b6c6cb3ea26157e3a78713cc9621dc46b2d7.tar.bz2 mana-b6e7b6c6cb3ea26157e3a78713cc9621dc46b2d7.tar.xz mana-b6e7b6c6cb3ea26157e3a78713cc9621dc46b2d7.zip |
Handling gender with an enum everywhere.
(cherry picked from mainline commit d3adc61aa4b4924f82d8cbc23bea26da7257da97)
Conflicts:
src/net/beinghandler.cpp
src/net/charserverhandler.cpp
src/player.cpp
src/player.h
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/beinghandler.cpp | 6 | ||||
-rw-r--r-- | src/net/charserverhandler.cpp | 5 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp index 4f525e8d..5b689266 100644 --- a/src/net/beinghandler.cpp +++ b/src/net/beinghandler.cpp @@ -137,7 +137,8 @@ void BeingHandler::handleMessage(MessageIn *msg) msg->readInt16(); // manner msg->readInt16(); // karma msg->readInt8(); // unknown - dstBeing->setGender(1 - msg->readInt8()); // gender + dstBeing->setGender( + (msg->readInt8() == 0) ? GENDER_FEMALE : GENDER_MALE); // Set these after the gender, as the sprites may be gender-specific dstBeing->setSprite(Being::BOTTOMCLOTHES_SPRITE, headBottom); @@ -404,7 +405,8 @@ void BeingHandler::handleMessage(MessageIn *msg) msg->readInt32(); // emblem msg->readInt16(); // manner msg->readInt8(); // karma - dstBeing->setGender(1 - msg->readInt8()); // gender + dstBeing->setGender( + (msg->readInt8() == 0) ? GENDER_FEMALE : GENDER_MALE); // Set these after the gender, as the sprites may be gender-specific dstBeing->setSprite(Being::WEAPON_SPRITE, weapon); diff --git a/src/net/charserverhandler.cpp b/src/net/charserverhandler.cpp index 11754b6f..eb724630 100644 --- a/src/net/charserverhandler.cpp +++ b/src/net/charserverhandler.cpp @@ -187,10 +187,11 @@ void CharServerHandler::handleMessage(MessageIn *msg) } } -LocalPlayer* CharServerHandler::readPlayerData(MessageIn &msg, int &slot) +LocalPlayer *CharServerHandler::readPlayerData(MessageIn &msg, int &slot) { LocalPlayer *tempPlayer = new LocalPlayer(mLoginData->account_ID, 0, NULL); - tempPlayer->setGender(1 - mLoginData->sex); + tempPlayer->setGender( + (mLoginData->sex == 0) ? GENDER_FEMALE : GENDER_MALE); tempPlayer->mCharId = msg.readInt32(); tempPlayer->setXp(msg.readInt32()); |