summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol_1_13.cpp
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2019-09-24 21:38:54 +0200
committerpeterbell10 <peterbell10@live.co.uk>2019-09-24 21:38:54 +0200
commiteda2fc42d9e6cd0f1216bff62433718f682e0bb2 (patch)
treedc6471c451e92d238a927e5b93035f740445a4a8 /src/Protocol/Protocol_1_13.cpp
parentNBTChunkSerializer: Cleaned up interface. (diff)
downloadcuberite-eda2fc42d9e6cd0f1216bff62433718f682e0bb2.tar
cuberite-eda2fc42d9e6cd0f1216bff62433718f682e0bb2.tar.gz
cuberite-eda2fc42d9e6cd0f1216bff62433718f682e0bb2.tar.bz2
cuberite-eda2fc42d9e6cd0f1216bff62433718f682e0bb2.tar.lz
cuberite-eda2fc42d9e6cd0f1216bff62433718f682e0bb2.tar.xz
cuberite-eda2fc42d9e6cd0f1216bff62433718f682e0bb2.tar.zst
cuberite-eda2fc42d9e6cd0f1216bff62433718f682e0bb2.zip
Diffstat (limited to 'src/Protocol/Protocol_1_13.cpp')
-rw-r--r--src/Protocol/Protocol_1_13.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/Protocol/Protocol_1_13.cpp b/src/Protocol/Protocol_1_13.cpp
index 87a7ff6da..f84e8d1bd 100644
--- a/src/Protocol/Protocol_1_13.cpp
+++ b/src/Protocol/Protocol_1_13.cpp
@@ -32,10 +32,12 @@ Implements the 1.13 protocol classes:
#define HANDLE_READ(ByteBuf, Proc, Type, Var) \
Type Var; \
- if (!ByteBuf.Proc(Var))\
- {\
- return;\
- }
+ do { \
+ if (!ByteBuf.Proc(Var))\
+ {\
+ return;\
+ } \
+ } while (false)
@@ -43,14 +45,16 @@ Implements the 1.13 protocol classes:
#define HANDLE_PACKET_READ(ByteBuf, Proc, Type, Var) \
Type Var; \
- { \
- if (!ByteBuf.Proc(Var)) \
+ do { \
{ \
+ if (!ByteBuf.Proc(Var)) \
+ { \
+ ByteBuf.CheckValid(); \
+ return false; \
+ } \
ByteBuf.CheckValid(); \
- return false; \
} \
- ByteBuf.CheckValid(); \
- }
+ } while (false)