diff options
Diffstat (limited to 'FICS/playerdb.c')
-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 |