From 745f40bc37a52480433b981a8dd45e4f3ea48921 Mon Sep 17 00:00:00 2001 From: MarcEricMartel Date: Sat, 16 Dec 2023 15:11:48 -0500 Subject: [PATCH] REVERT. --- SQCSim-common/netprotocol.cpp | 8 ++++---- SQCSim-srv/server.cpp | 3 --- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/SQCSim-common/netprotocol.cpp b/SQCSim-common/netprotocol.cpp index 2caf0eb..68feda2 100644 --- a/SQCSim-common/netprotocol.cpp +++ b/SQCSim-common/netprotocol.cpp @@ -1173,11 +1173,11 @@ netprot::Packet netprot::makePack(void* ptr, PACKET_TYPE type) { } void netprot::recvPacks(SOCKET sock, Buffer* buf, std::vector* lsPck) { - int len = 0,//buf->tmp ? buf->tmp - buf->ptr : 0, + int len = buf->tmp ? buf->tmp - buf->ptr : 0, end = 0; - char* cursor = nullptr,//buf->tmp ? buf->tmp : nullptr, - * next = buf->ptr,//buf->tmp ? buf->tmp + 1 : buf->ptr, - * last = buf->ptr;//buf->tmp ? buf->tmp : buf->ptr; + char* cursor = buf->tmp ? buf->tmp : nullptr, + * next = buf->tmp ? buf->tmp + 1 : buf->ptr, + * last = buf->tmp ? buf->tmp : buf->ptr; bool ended = true; struct pollfd fds[1]; diff --git a/SQCSim-srv/server.cpp b/SQCSim-srv/server.cpp index 1eefbf2..a2ca2c9 100644 --- a/SQCSim-srv/server.cpp +++ b/SQCSim-srv/server.cpp @@ -391,9 +391,6 @@ void Server::Run() { for (auto& bull: bullit) bullets.erase(bull); - if (!bullets.empty()) - bullets.clear(); - if (!bullit.empty()) bullit.clear();