diff options
Diffstat (limited to 'src/net/tmwa/beinghandler.cpp')
-rw-r--r-- | src/net/tmwa/beinghandler.cpp | 51 |
1 files changed, 21 insertions, 30 deletions
diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp index 98081db63..2768cd3e1 100644 --- a/src/net/tmwa/beinghandler.cpp +++ b/src/net/tmwa/beinghandler.cpp @@ -1224,21 +1224,7 @@ void BeingHandler::processBeingVisible(Net::MessageIn &msg) } else if (dstBeing->getType() == ActorType::NPC) { - switch (gender) - { - case 2: - dstBeing->setGender(Gender::FEMALE); - break; - case 3: - dstBeing->setGender(Gender::MALE); - break; - case 4: - dstBeing->setGender(Gender::OTHER); - break; - default: - dstBeing->setGender(Gender::UNSPECIFIED); - break; - } + setServerGender(dstBeing, gender); } uint8_t dir; @@ -1441,21 +1427,7 @@ void BeingHandler::processBeingMove(Net::MessageIn &msg) } else if (dstBeing->getType() == ActorType::NPC) { - switch (gender) - { - case 2: - dstBeing->setGender(Gender::FEMALE); - break; - case 3: - dstBeing->setGender(Gender::MALE); - break; - case 4: - dstBeing->setGender(Gender::OTHER); - break; - default: - dstBeing->setGender(Gender::UNSPECIFIED); - break; - } + setServerGender(dstBeing, gender); } uint16_t srcX, srcY, dstX, dstY; @@ -1594,4 +1566,23 @@ void BeingHandler::processBeingChangeDirection(Net::MessageIn &msg) const BLOCK_END("BeingHandler::processBeingChangeDirection") } +void BeingHandler::setServerGender(Being *const being, const uint8_t gender) +{ + switch (gender) + { + case 2: + being->setGender(Gender::FEMALE); + break; + case 3: + being->setGender(Gender::MALE); + break; + case 4: + being->setGender(Gender::OTHER); + break; + default: + being->setGender(Gender::UNSPECIFIED); + break; + } +} + } // namespace TmwAthena |