From 5779ac6a05af40486b43bcc196a8441fc20b0d68 Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 26 Sep 2022 20:41:14 +0100 Subject: [PATCH] Re-order IPs on successful connection to recent server --- src/m_misc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/m_misc.c b/src/m_misc.c index 29e4a35e2..afcd6749b 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -198,19 +198,19 @@ void M_AddToJoinedIPs(char *address, char *servname) UINT8 i = 0; // Check for dupes... - for (i = 0; i < NUMLOGIP; i++) + for (i = 0; i < NUMLOGIP-1; i++) { - // I don't care about the server name (this is broken anyway...) but definitely check the addresses + // Check the addresses if (strcmp(joinedIPlist[i][0], address) == 0) { - return; + break; } } CONS_Printf("Adding %s (%s) to list of manually joined IPs\n", servname, address); // Start by moving every IP up 1 slot (dropping the last IP in the table) - for (i = NUMLOGIP-1; i; i--) + for (; i; i--) { strcpy(joinedIPlist[i][0], joinedIPlist[i-1][0]); strcpy(joinedIPlist[i][1], joinedIPlist[i-1][1]);