Fix coding mistake in networking socket receive functions.

merge-requests/38/merge
Mr_Goldberg 2021-02-27 16:29:40 -05:00
parent 8e9d3e8f3a
commit 58a57cc91b
No known key found for this signature in database
GPG Key ID: 8597D87419DEF278
1 changed files with 3 additions and 3 deletions

View File

@ -793,7 +793,7 @@ int ReceiveMessagesOnConnection( HSteamNetConnection hConn, SteamNetworkingMessa
std::lock_guard<std::recursive_mutex> lock(global_mutex); std::lock_guard<std::recursive_mutex> lock(global_mutex);
SteamNetworkingMessage_t *msg = NULL; SteamNetworkingMessage_t *msg = NULL;
int messages = 0; int messages = 0;
while ((msg = get_steam_message_connection(hConn)) && messages < nMaxMessages) { while (messages < nMaxMessages && (msg = get_steam_message_connection(hConn))) {
ppOutMessages[messages] = msg; ppOutMessages[messages] = msg;
++messages; ++messages;
} }
@ -821,7 +821,7 @@ int ReceiveMessagesOnListenSocket( HSteamListenSocket hSocket, SteamNetworkingMe
auto socket_conn = std::begin(connect_sockets); auto socket_conn = std::begin(connect_sockets);
while (socket_conn != std::end(connect_sockets) && messages < nMaxMessages) { while (socket_conn != std::end(connect_sockets) && messages < nMaxMessages) {
if (socket_conn->second.listen_socket_id == hSocket) { if (socket_conn->second.listen_socket_id == hSocket) {
while ((msg = get_steam_message_connection(socket_conn->first)) && messages < nMaxMessages) { while (messages < nMaxMessages && (msg = get_steam_message_connection(socket_conn->first))) {
ppOutMessages[messages] = msg; ppOutMessages[messages] = msg;
++messages; ++messages;
} }
@ -1197,7 +1197,7 @@ int ReceiveMessagesOnPollGroup( HSteamNetPollGroup hPollGroup, SteamNetworkingMe
int messages = 0; int messages = 0;
for (auto c : group->second) { for (auto c : group->second) {
while ((msg = get_steam_message_connection(c)) && messages < nMaxMessages) { while (messages < nMaxMessages && (msg = get_steam_message_connection(c))) {
ppOutMessages[messages] = msg; ppOutMessages[messages] = msg;
++messages; ++messages;
} }