diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2023-12-31 15:52:39 +0100 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2023-12-31 15:52:39 +0100 |
commit | f0f084dd7098a85a3d924116d9999ad6f9955c0c (patch) | |
tree | 7cf72c34099798a77e06f91ee8b46e8b18969734 /FICS | |
parent | b02ccb5ee3ae0b0b255b65b560d9178d07688ace (diff) |
Reformatted player_find_pendto()
Diffstat (limited to 'FICS')
-rw-r--r-- | FICS/playerdb.c | 26 |
1 files changed, 13 insertions, 13 deletions
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 |