summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-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)