rendered paste bodydiff --git a/lib/netplay/netplay.c b/lib/netplay/netplay.cindex be1f6f3..6f9a966 100644--- a/lib/netplay/netplay.c+++ b/lib/netplay/netplay.c@@ -3317,6 +3317,7 @@ static void NETallowJoining(void) uint8_t j; uint8_t index; uint8_t rejected = 0;+ int tmp; char name[64]; int32_t MajorVersion = 0;@@ -3334,9 +3335,9 @@ static void NETallowJoining(void) NETint32_t(&Hash_Data); // NETCODE_HASH, not currently used NETend(); - index = NET_CreatePlayer(name);+ tmp = NET_CreatePlayer(name); - if (index == -1)+ if (tmp == -1) { // FIXME: No room. Dropping the player without warning since protocol doesn't seem to support rejection at this point debug(LOG_ERROR, "freeing temp socket %p, couldn't create player!", tmp_socket[i]);@@ -3346,6 +3347,8 @@ static void NETallowJoining(void) return; } + index = tmp;+ debug(LOG_NET, "freeing temp socket %p (%d)", tmp_socket[i], __LINE__); SocketSet_DelSocket(tmp_socket_set, tmp_socket[i]); NET_initBufferedSocket(connected_bsocket[index], tmp_socket[i]);