diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-10 13:02:49 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-10 13:02:49 +0300 |
commit | 173c48498dc55e9b86bee009427fb5ae58cd9821 (patch) | |
tree | f9bbddb6e0f5cdf26cbd64a1e1aa76e482b4ce0f /src/net/eathena | |
parent | 1a2147b4970a7aab6e610e0cd83ec29a47579e80 (diff) | |
download | manaplus-173c48498dc55e9b86bee009427fb5ae58cd9821.tar.gz manaplus-173c48498dc55e9b86bee009427fb5ae58cd9821.tar.bz2 manaplus-173c48498dc55e9b86bee009427fb5ae58cd9821.tar.xz manaplus-173c48498dc55e9b86bee009427fb5ae58cd9821.zip |
Split processBeingChangeLook into tow functions with net code and without.
Diffstat (limited to 'src/net/eathena')
-rw-r--r-- | src/net/eathena/beinghandler.cpp | 15 | ||||
-rw-r--r-- | src/net/eathena/beinghandler.h | 5 |
2 files changed, 15 insertions, 5 deletions
diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp index 82a40ee78..91a467bbf 100644 --- a/src/net/eathena/beinghandler.cpp +++ b/src/net/eathena/beinghandler.cpp @@ -289,7 +289,6 @@ void BeingHandler::processBeingChangeLook(Net::MessageIn &msg) const const uint8_t type = msg.readUInt8("type"); int id = 0; unsigned int id2 = 0U; - const std::string color; const bool look2 = msg.getId() == SMSG_BEING_CHANGE_LOOKS2; if (!look2) @@ -305,15 +304,21 @@ void BeingHandler::processBeingChangeLook(Net::MessageIn &msg) const id2 = 1; } - if (!dstBeing) + if (!localPlayer || !dstBeing) return; + processBeingChangeLookContinue(dstBeing, type, id, id2); +} + +void BeingHandler::processBeingChangeLookContinue(Being *const dstBeing, + const uint8_t type, + const int id, + const int id2) const +{ if (dstBeing->getType() == ActorType::PLAYER) dstBeing->setOtherTime(); - if (!localPlayer) - return; - + const std::string color; switch (type) { case 0: // change race diff --git a/src/net/eathena/beinghandler.h b/src/net/eathena/beinghandler.h index 9d70bd860..0d4c71a77 100644 --- a/src/net/eathena/beinghandler.h +++ b/src/net/eathena/beinghandler.h @@ -75,6 +75,11 @@ class BeingHandler final : public MessageHandler, public Ea::BeingHandler void processRanksList(Net::MessageIn &msg) const; void processBeingChangeDirection(Net::MessageIn &msg) const; + + void processBeingChangeLookContinue(Being *const dstBeing, + const uint8_t type, + const int id, + const int id2) const; }; } // namespace EAthena |