From f0f084dd7098a85a3d924116d9999ad6f9955c0c Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Sun, 31 Dec 2023 15:52:39 +0100 Subject: Reformatted player_find_pendto() --- FICS/playerdb.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'FICS') diff --git a/FICS/playerdb.c b/FICS/playerdb.c index 4b88ae9..6b5beca 100644 --- a/FICS/playerdb.c +++ b/FICS/playerdb.c @@ -1374,21 +1374,21 @@ PUBLIC void player_pend_print(int p, pending *pend) pprintf(p, "%s\n", outstr); } -PUBLIC int player_find_pendto(int p, int p1, int type) +PUBLIC int +player_find_pendto(int p, int p1, int type) { - int i; + for (int i = 0; i < parray[p].num_to; i++) { + if (parray[p].p_to_list[i].whoto != p1 && p1 != -1) + continue; + if (type < 0 || parray[p].p_to_list[i].type == type) + return i; + if (type == PEND_BUGHOUSE && + parray[p].p_to_list[i].type == PEND_MATCH && + !strcmp(parray[p].p_to_list[i].char2, "bughouse")) + return i; + } - for (i = 0; i < parray[p].num_to; i++) { - if (parray[p].p_to_list[i].whoto != p1 && p1 != -1) - continue; - if (type < 0 || parray[p].p_to_list[i].type == type) - return i; - if (type == PEND_BUGHOUSE - && parray[p].p_to_list[i].type == PEND_MATCH - && !strcmp(parray[p].p_to_list[i].char2, "bughouse")) - return i; - } - return -1; + return -1; } PUBLIC int -- cgit v1.2.3