From 9d33241e8fa720f2a0575e3c3748fe7597709faf Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Sun, 30 Mar 2025 03:37:25 +0200 Subject: Attempt to fix newly introduced bad behavior --- FICS/playerdb.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'FICS') diff --git a/FICS/playerdb.c b/FICS/playerdb.c index 1453a58..309a8fc 100644 --- a/FICS/playerdb.c +++ b/FICS/playerdb.c @@ -1809,10 +1809,10 @@ player_remove_pendto(int p, int p1, int type) removed = true; } - if (removed) - parray[p].num_to -= 1; + UNUSED_VAR(removed); + parray[p].num_to -= 1; - return (removed ? 0 : -1); + return (0); } PUBLIC int @@ -1872,10 +1872,10 @@ player_remove_pendfrom(int p, int p1, int type) removed = true; } - if (removed) - parray[p].num_from -= 1; + UNUSED_VAR(removed); + parray[p].num_from -= 1; - return (removed ? 0 : -1); + return (0); } PUBLIC int @@ -1913,7 +1913,7 @@ player_remove_request(int p, int p1, int type) bool removed; int to = 0, from = 0; - while ((to = player_find_pendto(p, p1, type)) != -1) { + while (to != -1 && (to = player_find_pendto(p, p1, type)) != -1) { removed = false; for (; to < parray[p].num_to - 1; to++) { @@ -1927,11 +1927,11 @@ player_remove_request(int p, int p1, int type) removed = true; } - if (removed) - parray[p].num_to -= 1; + UNUSED_VAR(removed); + parray[p].num_to -= 1; } - while ((from = player_find_pendfrom(p1, p, type)) != -1) { + while (from != -1 && (from = player_find_pendfrom(p1, p, type)) != -1) { removed = false; for (; from < parray[p1].num_from - 1; from++) { @@ -1946,8 +1946,8 @@ player_remove_request(int p, int p1, int type) removed = true; } - if (removed) - parray[p1].num_from -= 1; + UNUSED_VAR(removed); + parray[p1].num_from -= 1; } if ((type == PEND_ALL || type == PEND_MATCH) && parray[p].partner >= 0) -- cgit v1.2.3