diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-05-06 18:37:06 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-05-06 18:37:06 +0300 |
commit | c25141f02a5b3dcddcc93ca5d2bd2fcdad5efb31 (patch) | |
tree | ac124c630bc17ef10a8885a49fbb387f7091d15d /src/net | |
parent | 88697bc3503090194877b241b987ddc751034166 (diff) | |
download | mv-c25141f02a5b3dcddcc93ca5d2bd2fcdad5efb31.tar.gz mv-c25141f02a5b3dcddcc93ca5d2bd2fcdad5efb31.tar.bz2 mv-c25141f02a5b3dcddcc93ca5d2bd2fcdad5efb31.tar.xz mv-c25141f02a5b3dcddcc93ca5d2bd2fcdad5efb31.zip |
Add strong typed bool type Enable.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/eathena/beinghandler.cpp | 8 | ||||
-rw-r--r-- | src/net/tmwa/beinghandler.cpp | 3 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp index 1c913a691..93733d2fa 100644 --- a/src/net/eathena/beinghandler.cpp +++ b/src/net/eathena/beinghandler.cpp @@ -1176,7 +1176,8 @@ void BeingHandler::processBeingStatusChange(Net::MessageIn &msg) // Status change const uint16_t status = msg.readInt16("status"); const int id = msg.readInt32("being id"); - const bool flag = msg.readUInt8("flag: 0: stop, 1: start"); + const Enable flag = fromBool( + msg.readUInt8("flag: 0: stop, 1: start"), Enable); msg.readInt32("total"); msg.readInt32("left"); msg.readInt32("val1"); @@ -1201,7 +1202,8 @@ void BeingHandler::processBeingStatusChange2(Net::MessageIn &msg) // Status change const uint16_t status = msg.readInt16("status"); const int id = msg.readInt32("being id"); - const bool flag = msg.readUInt8("flag: 0: stop, 1: start"); + const Enable flag = fromBool( + msg.readUInt8("flag: 0: stop, 1: start"), Enable); msg.readInt32("left"); msg.readInt32("val1"); msg.readInt32("val2"); @@ -1613,7 +1615,7 @@ void BeingHandler::processPlaterStatusChangeNoTick(Net::MessageIn &msg) { const uint16_t status = msg.readInt16("index"); const int id = msg.readInt32("account id"); - const bool flag = msg.readUInt8("state") ? 1 : 0; + const Enable flag = fromBool(msg.readUInt8("state") ? true : false, Enable); Being *const dstBeing = actorManager->findBeing(id); if (!dstBeing) diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp index 580b4b3f2..8277e4805 100644 --- a/src/net/tmwa/beinghandler.cpp +++ b/src/net/tmwa/beinghandler.cpp @@ -1329,7 +1329,8 @@ void BeingHandler::processBeingStatusChange(Net::MessageIn &msg) // Status change const uint16_t status = msg.readInt16("status"); const int id = msg.readInt32("being id"); - const bool flag = msg.readUInt8("flag: 0: stop, 1: start"); + const Enable flag = fromBool( + msg.readUInt8("flag: 0: stop, 1: start"), Enable); Being *const dstBeing = actorManager->findBeing(id); if (dstBeing) |