aboutsummaryrefslogtreecommitdiffstats
path: root/FICS
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2024-04-01 19:20:23 +0200
committerMarkus Uhlin <markus@nifty-networks.net>2024-04-01 19:20:23 +0200
commit89cc559a614a086b6927ff5d5d25e77029c5d4fa (patch)
treea4a95ccfac5aef538fac8e5568c35e11cbddbefe /FICS
parent57fb01b719ec295d0785b029b0f622ace721406b (diff)
Reformatted RePartner() and made it private
Diffstat (limited to 'FICS')
-rw-r--r--FICS/variable.c55
1 files changed, 33 insertions, 22 deletions
diff --git a/FICS/variable.c b/FICS/variable.c
index 7bb181e..7840b40 100644
--- a/FICS/variable.c
+++ b/FICS/variable.c
@@ -486,28 +486,39 @@ PRIVATE int set_prompt(int p, char *var, char *val)
return VAR_OK;
}
-int RePartner (int p, int new)
-{
- int pOld;
-
- if (p < 0)
- return -1;
- pOld = parray[p].partner;
- if (parray[pOld].partner == p) {
- if (new >= 0)
- pprintf_prompt (pOld, "Your partner has just chosen a new partner.\n");
- else
- pprintf_prompt (pOld, "Your partner has just unset his/her partner.\n");
- player_withdraw_offers (pOld, -1, PEND_BUGHOUSE);
- player_decline_offers (pOld, -1, PEND_BUGHOUSE);
- player_withdraw_offers (p, -1, PEND_BUGHOUSE);
- player_decline_offers (p, -1, PEND_BUGHOUSE);
- }
- player_withdraw_offers(p, -1, PEND_PARTNER);
- player_decline_offers(p, -1, PEND_PARTNER);
- parray[pOld].partner = -1;
- parray[p].partner = new;
- return new;
+PRIVATE int
+RePartner(int p, int new)
+{
+ int pOld;
+
+ if (p < 0)
+ return -1;
+
+ pOld = parray[p].partner;
+
+ if (parray[pOld].partner == p) {
+ if (new >= 0) {
+ pprintf_prompt(pOld, "Your partner has just chosen "
+ "a new partner.\n");
+ } else {
+ pprintf_prompt(pOld, "Your partner has just unset "
+ "his/her partner.\n");
+ }
+
+ player_withdraw_offers(pOld, -1, PEND_BUGHOUSE);
+ player_decline_offers(pOld, -1, PEND_BUGHOUSE);
+
+ player_withdraw_offers(p, -1, PEND_BUGHOUSE);
+ player_decline_offers(p, -1, PEND_BUGHOUSE);
+ }
+
+ player_withdraw_offers(p, -1, PEND_PARTNER);
+ player_decline_offers(p, -1, PEND_PARTNER);
+
+ parray[pOld].partner = -1;
+ parray[p].partner = new;
+
+ return new;
}
PUBLIC int