aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/playerdb.c
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2023-12-31 15:16:30 +0100
committerMarkus Uhlin <markus@nifty-networks.net>2023-12-31 15:16:30 +0100
commit153e411d353b7fe5465916d902c02446a6857468 (patch)
tree4bbd4d0c021fdb9fb4036b0ad20a1b391539c8ee /FICS/playerdb.c
parentbef8e100a40f913a1313b11f0ae3a9bba42f8b52 (diff)
Reformatted player_remove_request()
Diffstat (limited to 'FICS/playerdb.c')
-rw-r--r--FICS/playerdb.c52
1 files changed, 29 insertions, 23 deletions
diff --git a/FICS/playerdb.c b/FICS/playerdb.c
index 63bbdd2..e392f10 100644
--- a/FICS/playerdb.c
+++ b/FICS/playerdb.c
@@ -1479,32 +1479,38 @@ PUBLIC int player_add_request(int p, int p1, int type, int param)
return 0;
}
-PUBLIC int player_remove_request(int p, int p1, int type)
+PUBLIC int
+player_remove_request(int p, int p1, int type)
{
- int to = 0, from = 0;
+ int to = 0, from = 0;
- while (to != -1) {
- to = player_find_pendto(p, p1, type);
- if (to != -1) {
- for (; to < parray[p].num_to - 1; to++)
- parray[p].p_to_list[to] = parray[p].p_to_list[to + 1];
- parray[p].num_to = parray[p].num_to - 1;
- }
- }
- while (from != -1) {
- from = player_find_pendfrom(p1, p, type);
- if (from != -1) {
- for (; from < parray[p1].num_from - 1; from++)
- parray[p1].p_from_list[from] = parray[p1].p_from_list[from + 1];
- parray[p1].num_from = parray[p1].num_from - 1;
- }
- }
- if ((type == PEND_ALL || type == PEND_MATCH)
- && parray[p].partner >= 0)
- player_remove_request (parray[p].partner, p1, PEND_BUGHOUSE);
- return 0;
-}
+ while (to != -1) {
+ if ((to = player_find_pendto(p, p1, type)) != -1) {
+ for (; to < parray[p].num_to - 1; to++) {
+ parray[p].p_to_list[to] =
+ parray[p].p_to_list[to + 1];
+ }
+ parray[p].num_to = (parray[p].num_to - 1);
+ }
+ }
+
+ while (from != -1) {
+ if ((from = player_find_pendfrom(p1, p, type)) != -1) {
+ for (; from < parray[p1].num_from - 1; from++) {
+ parray[p1].p_from_list[from] =
+ parray[p1].p_from_list[from + 1];
+ }
+
+ parray[p1].num_from = (parray[p1].num_from - 1);
+ }
+ }
+
+ if ((type == PEND_ALL || type == PEND_MATCH) && parray[p].partner >= 0)
+ player_remove_request (parray[p].partner, p1, PEND_BUGHOUSE);
+
+ return 0;
+}
PUBLIC int
player_decline_offers(int p, int p1, int offerType)