diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-06-03 14:31:43 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-06-03 14:31:43 +0300 |
commit | b643a5c48d53dbeca7672e3c8b5182f9d698abcb (patch) | |
tree | ab596dc9a0c573764c1e0b427f22303faa1bfec1 /src/net/eathena | |
parent | 6281c1281fe85a1c75155df44c99aa843561a4f2 (diff) | |
download | plus-b643a5c48d53dbeca7672e3c8b5182f9d698abcb.tar.gz plus-b643a5c48d53dbeca7672e3c8b5182f9d698abcb.tar.bz2 plus-b643a5c48d53dbeca7672e3c8b5182f9d698abcb.tar.xz plus-b643a5c48d53dbeca7672e3c8b5182f9d698abcb.zip |
Convert PacketShare enum into strong typed enum.
Diffstat (limited to 'src/net/eathena')
-rw-r--r-- | src/net/eathena/partyhandler.cpp | 14 | ||||
-rw-r--r-- | src/net/eathena/partyhandler.h | 6 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/net/eathena/partyhandler.cpp b/src/net/eathena/partyhandler.cpp index d886270ae..f22e5aabc 100644 --- a/src/net/eathena/partyhandler.cpp +++ b/src/net/eathena/partyhandler.cpp @@ -199,9 +199,9 @@ void PartyHandler::chat(const std::string &text) const } // +++ must be 3 types item, exp, pickup -void PartyHandler::setShareExperience(const Net::PartyShare::Type share) const +void PartyHandler::setShareExperience(const PartyShareT share) const { - if (share == Net::PartyShare::NOT_POSSIBLE) + if (share == PartyShare::NOT_POSSIBLE) return; createOutPacket(CMSG_PARTY_SETTINGS); @@ -210,9 +210,9 @@ void PartyHandler::setShareExperience(const Net::PartyShare::Type share) const } // +++ must be 3 types item, exp, pickup -void PartyHandler::setShareItems(const Net::PartyShare::Type share) const +void PartyHandler::setShareItems(const PartyShareT share) const { - if (share == Net::PartyShare::NOT_POSSIBLE) + if (share == PartyShare::NOT_POSSIBLE) return; createOutPacket(CMSG_PARTY_SETTINGS); @@ -266,8 +266,10 @@ void PartyHandler::processPartySettings(Net::MessageIn &msg) } msg.readInt32("party exp"); - const int16_t exp = msg.readInt8("exp"); - const int16_t item = msg.readInt8("item"); + const PartyShareT exp = static_cast<PartyShareT>( + msg.readInt8("share exp")); + const PartyShareT item = static_cast<PartyShareT>( + msg.readInt8("share item")); processPartySettingsContinue(msg, exp, item); } diff --git a/src/net/eathena/partyhandler.h b/src/net/eathena/partyhandler.h index 614307954..22cabd81e 100644 --- a/src/net/eathena/partyhandler.h +++ b/src/net/eathena/partyhandler.h @@ -56,11 +56,9 @@ class PartyHandler final : public MessageHandler, public Ea::PartyHandler void chat(const std::string &text) const override final; - void setShareExperience(const Net::PartyShare::Type share) - const override final; + void setShareExperience(const PartyShareT share) const override final; - void setShareItems(const Net::PartyShare::Type share) - const override final; + void setShareItems(const PartyShareT share) const override final; void changeLeader(const std::string &name) const override final; |