From b594a323a6a63075351f0d239467a9598fbf3561 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Sun, 17 Jul 2022 20:51:48 +0200 Subject: [PATCH] Change return type of `CNetBase::IsSeqInBackroom` from `int` to `bool` --- src/engine/shared/network.cpp | 10 +++++----- src/engine/shared/network.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/engine/shared/network.cpp b/src/engine/shared/network.cpp index d94404b2f..6353fa1e3 100644 --- a/src/engine/shared/network.cpp +++ b/src/engine/shared/network.cpp @@ -339,23 +339,23 @@ unsigned char *CNetChunkHeader::Unpack(unsigned char *pData, int Split) return pData + 2; } -int CNetBase::IsSeqInBackroom(int Seq, int Ack) +bool CNetBase::IsSeqInBackroom(int Seq, int Ack) { int Bottom = (Ack - NET_MAX_SEQUENCE / 2); if(Bottom < 0) { if(Seq <= Ack) - return 1; + return true; if(Seq >= (Bottom + NET_MAX_SEQUENCE)) - return 1; + return true; } else { if(Seq <= Ack && Seq >= Bottom) - return 1; + return true; } - return 0; + return false; } IOHANDLE CNetBase::ms_DataLogSent = 0; diff --git a/src/engine/shared/network.h b/src/engine/shared/network.h index 41f35db3c..d4d9ab824 100644 --- a/src/engine/shared/network.h +++ b/src/engine/shared/network.h @@ -544,7 +544,7 @@ public: static int UnpackPacket(unsigned char *pBuffer, int Size, CNetPacketConstruct *pPacket, bool &Sixup, SECURITY_TOKEN *pSecurityToken = nullptr, SECURITY_TOKEN *pResponseToken = nullptr); // The backroom is ack-NET_MAX_SEQUENCE/2. Used for knowing if we acked a packet or not - static int IsSeqInBackroom(int Seq, int Ack); + static bool IsSeqInBackroom(int Seq, int Ack); }; #endif