From b643a5c48d53dbeca7672e3c8b5182f9d698abcb Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 3 Jun 2015 14:31:43 +0300 Subject: Convert PacketShare enum into strong typed enum. --- src/net/tmwa/partyhandler.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/net/tmwa/partyhandler.cpp') diff --git a/src/net/tmwa/partyhandler.cpp b/src/net/tmwa/partyhandler.cpp index 8bb143d75..f503b666c 100644 --- a/src/net/tmwa/partyhandler.cpp +++ b/src/net/tmwa/partyhandler.cpp @@ -183,9 +183,9 @@ void PartyHandler::chat(const std::string &text) const outMsg.writeString(text, static_cast(text.length()), "text"); } -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); @@ -193,9 +193,9 @@ void PartyHandler::setShareExperience(const Net::PartyShare::Type share) const outMsg.writeInt16(static_cast(mShareItems), "share items"); } -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); @@ -214,8 +214,10 @@ void PartyHandler::processPartySettings(Net::MessageIn &msg) } // These seem to indicate the sharing mode for exp and items - const int16_t exp = msg.readInt16("share exp"); - const int16_t item = msg.readInt16("share items"); + const PartyShareT exp = static_cast( + msg.readInt16("share exp")); + const PartyShareT item = static_cast( + msg.readInt16("share items")); processPartySettingsContinue(msg, exp, item); } -- cgit v1.2.3-70-g09d2